mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-31 12:49:41 +01:00
CLI: bail out when profile does not exist (#171646)
This commit is contained in:
committed by
GitHub
parent
054a2e7f9d
commit
a3b2f85ba4
@@ -58,7 +58,7 @@ import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender';
|
||||
import { buildTelemetryMessage } from 'vs/platform/telemetry/node/telemetry';
|
||||
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
|
||||
import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService';
|
||||
import { IUserDataProfilesService, PROFILES_ENABLEMENT_CONFIG } from 'vs/platform/userDataProfile/common/userDataProfile';
|
||||
import { IUserDataProfile, IUserDataProfilesService, PROFILES_ENABLEMENT_CONFIG } from 'vs/platform/userDataProfile/common/userDataProfile';
|
||||
import { UserDataProfilesService } from 'vs/platform/userDataProfile/node/userDataProfile';
|
||||
import { resolveMachineId } from 'vs/platform/telemetry/node/telemetryUtils';
|
||||
import { ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/node/extensionsProfileScannerService';
|
||||
@@ -251,7 +251,14 @@ class CliMain extends Disposable {
|
||||
}
|
||||
|
||||
private async doRun(environmentService: INativeEnvironmentService, fileService: IFileService, userDataProfilesService: IUserDataProfilesService, instantiationService: IInstantiationService): Promise<void> {
|
||||
const profileLocation = (environmentService.args.profile ? userDataProfilesService.profiles.find(p => p.name === environmentService.args.profile) ?? userDataProfilesService.defaultProfile : userDataProfilesService.defaultProfile).extensionsResource;
|
||||
let profile: IUserDataProfile | undefined = undefined;
|
||||
if (environmentService.args.profile) {
|
||||
profile = userDataProfilesService.profiles.find(p => p.name === environmentService.args.profile);
|
||||
if (!profile) {
|
||||
throw new Error(`Profile '${environmentService.args.profile}' not found.`);
|
||||
}
|
||||
}
|
||||
const profileLocation = (profile ?? userDataProfilesService.defaultProfile).extensionsResource;
|
||||
|
||||
// Install Source
|
||||
if (this.argv['install-source']) {
|
||||
|
||||
Reference in New Issue
Block a user