Create data directory path before moving old directory there

This commit is contained in:
Asher 2019-03-12 15:05:47 -05:00
parent e1dc6967ed
commit ba37a34fa2
No known key found for this signature in database
GPG Key ID: 7BB4BA9C783D2BBC
1 changed files with 1 additions and 0 deletions

View File

@ -55,6 +55,7 @@ export class Entry extends Command {
if (!fs.existsSync(dataDir)) { if (!fs.existsSync(dataDir)) {
const oldDataDir = path.resolve(path.join(os.homedir(), ".code-server")); const oldDataDir = path.resolve(path.join(os.homedir(), ".code-server"));
if (fs.existsSync(oldDataDir)) { if (fs.existsSync(oldDataDir)) {
await mkdirP(path.basename(dataDir));
fs.renameSync(oldDataDir, dataDir); fs.renameSync(oldDataDir, dataDir);
logger.info(`Moved data directory from ${oldDataDir} to ${dataDir}`); logger.info(`Moved data directory from ${oldDataDir} to ${dataDir}`);
} }