-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathOSPickStep.ts
More file actions
30 lines (25 loc) · 1.48 KB
/
OSPickStep.ts
File metadata and controls
30 lines (25 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { AzureWizardPromptStep, IAzureQuickPickItem } from "@microsoft/vscode-azext-utils";
import { localize } from "../../../../utils/localize";
import { BuildImageInAzureImageSourceContext } from "./BuildImageInAzureImageSourceContext";
export enum AcrBuildSupportedOS {
Windows = 'Windows',
Linux = 'Linux'
}
export class OSPickStep extends AzureWizardPromptStep<BuildImageInAzureImageSourceContext> {
public async prompt(context: BuildImageInAzureImageSourceContext): Promise<void> {
const placeHolder: string = localize('imageOSPrompt', 'Select image base OS');
const picks: IAzureQuickPickItem<AcrBuildSupportedOS>[] = [
{ label: AcrBuildSupportedOS.Linux, data: AcrBuildSupportedOS.Linux, suppressPersistence: true },
{ label: AcrBuildSupportedOS.Windows, data: AcrBuildSupportedOS.Windows, suppressPersistence: true },
];
context.os = (await context.ui.showQuickPick(picks, { placeHolder })).data;
context.telemetry.properties.imageBaseOs = context.os;
}
public shouldPrompt(context: BuildImageInAzureImageSourceContext): boolean {
return !context.os;
}
}