From 09e3cfd8816eea8c06331b9377d67fba9a6f8717 Mon Sep 17 00:00:00 2001 From: Asher Date: Wed, 10 Jul 2019 17:00:36 -0500 Subject: [PATCH] Create extension directory on startup --- server.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/server.ts b/server.ts index 160ad0f9..349d8e08 100644 --- a/server.ts +++ b/server.ts @@ -11,6 +11,7 @@ import { getMediaMime } from "vs/base/common/mime"; import { extname } from "vs/base/common/path"; import { UriComponents, URI } from "vs/base/common/uri"; import { IPCServer, ClientConnectionEvent, StaticRouter } from "vs/base/parts/ipc/common/ipc"; +import { mkdirp } from "vs/base/node/pfs"; import { LogsDataCleaner } from "vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner"; import { IConfigurationService } from "vs/platform/configuration/common/configuration"; import { ConfigurationService } from "vs/platform/configuration/node/configurationService"; @@ -227,6 +228,18 @@ export class MainServer extends Server { }); } + public async listen(): Promise { + const environment = (this.services.get(IEnvironmentService) as EnvironmentService); + const mkdirs = Promise.all([ + environment.extensionsPath, + ].map((p) => mkdirp(p))); + const [address] = await Promise.all([ + super.listen(), + mkdirs, + ]); + return address; + } + protected async handleRequest( base: string, requestPath: string,