提交 510aaf6f 编写于 作者: J Johannes Rieken

make commit id part of the cached data path, #23883

上级 8a241fee
......@@ -125,7 +125,13 @@ function getNodeCachedDataDir() {
return Promise.resolve(undefined);
}
var dir = path.join(app.getPath('userData'), 'CachedData');
// find commit id
var productJson = require(path.join(__dirname, '../product.json'));
if (!productJson.commit) {
return Promise.resolve(undefined);
}
var dir = path.join(app.getPath('userData'), 'CachedData', productJson.commit);
return mkdirp(dir).then(undefined, function (err) { /*ignore*/ });
}
......
......@@ -371,7 +371,7 @@ function createPaths(environmentService: IEnvironmentService): TPromise<any> {
environmentService.extensionsPath,
environmentService.nodeCachedDataDir
];
return TPromise.join(paths.map(p => mkdirp(p))) as TPromise<any>;
return TPromise.join(paths.map(p => p && mkdirp(p))) as TPromise<any>;
}
function createServices(args: ParsedArgs): IInstantiationService {
......
......@@ -730,7 +730,7 @@ export class WindowsManager implements IWindowsMainService {
configuration.filesToOpen = filesToOpen;
configuration.filesToCreate = filesToCreate;
configuration.filesToDiff = filesToDiff;
configuration.nodeCachedDataDir = this.environmentService.isBuilt && this.environmentService.nodeCachedDataDir;
configuration.nodeCachedDataDir = this.environmentService.nodeCachedDataDir;
return configuration;
}
......
......@@ -129,7 +129,7 @@ export class EnvironmentService implements IEnvironmentService {
get sharedIPCHandle(): string { return getIPCHandle(this.userDataPath, 'shared'); }
@memoize
get nodeCachedDataDir(): string { return path.join(this.userDataPath, 'CachedData'); }
get nodeCachedDataDir(): string { return this.isBuilt ? path.join(this.userDataPath, 'CachedData', product.commit) : undefined; }
constructor(private _args: ParsedArgs, private _execPath: string) { }
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册