mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
make commit id part of the cached data path, #23883
This commit is contained in:
parent
8a241feed4
commit
510aaf6fb0
|
@ -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) { }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue