mirror of
https://github.com/microsoft/vscode.git
synced 2026-06-02 21:55:33 +01:00
Merge pull request #124346 from microsoft/ben/pfs-promises
fs - favor non promise based methods (fix #124176)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
import { release, hostname } from 'os';
|
||||
import * as fs from 'fs';
|
||||
import { gracefulify } from 'graceful-fs';
|
||||
import { Promises } from 'vs/base/node/pfs';
|
||||
import { isAbsolute, join } from 'vs/base/common/path';
|
||||
import { raceTimeout } from 'vs/base/common/async';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
@@ -102,7 +103,7 @@ class CliMain extends Disposable {
|
||||
services.set(INativeEnvironmentService, environmentService);
|
||||
|
||||
// Init folders
|
||||
await Promise.all([environmentService.appSettingsHome.fsPath, environmentService.extensionsPath].map(path => path ? fs.promises.mkdir(path, { recursive: true }) : undefined));
|
||||
await Promise.all([environmentService.appSettingsHome.fsPath, environmentService.extensionsPath].map(path => path ? Promises.mkdir(path, { recursive: true }) : undefined));
|
||||
|
||||
// Log
|
||||
const logLevel = getLogLevel(environmentService);
|
||||
@@ -155,7 +156,7 @@ class CliMain extends Disposable {
|
||||
commonProperties: (async () => {
|
||||
let machineId: string | undefined = undefined;
|
||||
try {
|
||||
const storageContents = await fs.promises.readFile(join(environmentService.userDataPath, 'storage.json'));
|
||||
const storageContents = await Promises.readFile(join(environmentService.userDataPath, 'storage.json'));
|
||||
machineId = JSON.parse(storageContents.toString())[machineIdKey];
|
||||
} catch (error) {
|
||||
if (error.code !== 'ENOENT') {
|
||||
|
||||
Reference in New Issue
Block a user