Skip to content

Commit 9ff29d1

Browse files
committed
Make sure directories exist
Fixes #3040.
1 parent b21a9af commit 9ff29d1

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lib/vscode/src/vs/server/node/server.ts

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as fs from 'fs';
1+
import { promises as fs } from 'fs';
22
import * as net from 'net';
33
import { hostname, release } from 'os';
44
import * as path from 'path';
@@ -213,8 +213,18 @@ export class Vscode {
213213
private async initializeServices(args: NativeParsedArgs): Promise<void> {
214214
const productService = { _serviceBrand: undefined, ...product };
215215
const environmentService = new NativeEnvironmentService(args, productService);
216-
// https://github.com/cdr/code-server/issues/1693
217-
fs.mkdirSync(environmentService.globalStorageHome.fsPath, { recursive: true });
216+
217+
await Promise.all([
218+
environmentService.extensionsPath,
219+
environmentService.logsPath,
220+
environmentService.globalStorageHome.fsPath,
221+
environmentService.workspaceStorageHome.fsPath,
222+
...environmentService.extraExtensionPaths,
223+
...environmentService.extraBuiltinExtensionPaths,
224+
].map((p) => fs.mkdir(p, { recursive: true }).catch((error) => {
225+
logger.warn(error.message || error);
226+
})));
227+
218228
const logService = new MultiplexLogService([
219229
new ConsoleLogger(getLogLevel(environmentService)),
220230
new SpdLogLogger(RemoteExtensionLogFileName, path.join(environmentService.logsPath, `${RemoteExtensionLogFileName}.log`), false, getLogLevel(environmentService))

0 commit comments

Comments
 (0)