mirror of https://git.tuxpa.in/a/code-server.git
Create data directory path before moving old directory there
This commit is contained in:
parent
e1dc6967ed
commit
ba37a34fa2
|
@ -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}`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue