move globalStorageHome to userDataProfileService

This commit is contained in:
Sandeep Somavarapu
2022-05-22 09:22:48 +02:00
parent 80865fedf6
commit 0ccc294e64
38 changed files with 176 additions and 120 deletions
+3 -3
View File
@@ -131,11 +131,11 @@ class CliMain extends Disposable {
fileService.registerProvider(Schemas.file, diskFileSystemProvider);
// User Data Profiles
const userDataProfilesService = new UserDataProfilesService(environmentService, logService);
const userDataProfilesService = new UserDataProfilesService(undefined, environmentService, logService);
services.set(IUserDataProfilesService, userDataProfilesService);
// Configuration
const configurationService = this._register(new ConfigurationService(userDataProfilesService.currentProfile.settingsResource, fileService));
const configurationService = this._register(new ConfigurationService(userDataProfilesService, fileService));
services.set(IConfigurationService, configurationService);
// Init config
@@ -175,7 +175,7 @@ class CliMain extends Disposable {
commonProperties: (async () => {
let machineId: string | undefined = undefined;
try {
const storageContents = await Promises.readFile(joinPath(environmentService.globalStorageHome, 'storage.json').fsPath);
const storageContents = await Promises.readFile(joinPath(userDataProfilesService.defaultProfile.globalStorageHome, 'storage.json').fsPath);
machineId = JSON.parse(storageContents.toString())[machineIdKey];
} catch (error) {
if (error.code !== 'ENOENT') {