Skip to content

Make sure directories exist #3309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 7, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make sure directories exist
Fixes #3040.
  • Loading branch information
code-asher committed May 7, 2021
commit 9ff29d17fb36c7efdf96f068d9fc9fb0da76a15f
16 changes: 13 additions & 3 deletions lib/vscode/src/vs/server/node/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as fs from 'fs';
import { promises as fs } from 'fs';
import * as net from 'net';
import { hostname, release } from 'os';
import * as path from 'path';
Expand Down Expand Up @@ -213,8 +213,18 @@ export class Vscode {
private async initializeServices(args: NativeParsedArgs): Promise<void> {
const productService = { _serviceBrand: undefined, ...product };
const environmentService = new NativeEnvironmentService(args, productService);
// https://github.com/cdr/code-server/issues/1693
fs.mkdirSync(environmentService.globalStorageHome.fsPath, { recursive: true });

await Promise.all([
environmentService.extensionsPath,
environmentService.logsPath,
environmentService.globalStorageHome.fsPath,
environmentService.workspaceStorageHome.fsPath,
...environmentService.extraExtensionPaths,
...environmentService.extraBuiltinExtensionPaths,
].map((p) => fs.mkdir(p, { recursive: true }).catch((error) => {
logger.warn(error.message || error);
})));

const logService = new MultiplexLogService([
new ConsoleLogger(getLogLevel(environmentService)),
new SpdLogLogger(RemoteExtensionLogFileName, path.join(environmentService.logsPath, `${RemoteExtensionLogFileName}.log`), false, getLogLevel(environmentService))
Expand Down