From ba37a34fa24a32f16f8d4cf1fe39cbf30a5ca1d0 Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 12 Mar 2019 15:05:47 -0500 Subject: [PATCH] Create data directory path before moving old directory there --- packages/server/src/cli.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/server/src/cli.ts b/packages/server/src/cli.ts index b44cdc4a..10f19dc4 100644 --- a/packages/server/src/cli.ts +++ b/packages/server/src/cli.ts @@ -55,6 +55,7 @@ export class Entry extends Command { if (!fs.existsSync(dataDir)) { const oldDataDir = path.resolve(path.join(os.homedir(), ".code-server")); if (fs.existsSync(oldDataDir)) { + await mkdirP(path.basename(dataDir)); fs.renameSync(oldDataDir, dataDir); logger.info(`Moved data directory from ${oldDataDir} to ${dataDir}`); }