-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathOSPickStep.ts
More file actions
24 lines (20 loc) · 1.21 KB
/
OSPickStep.ts
File metadata and controls
24 lines (20 loc) · 1.21 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
/*---------------------------------------------------------------------------------------------
* 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 { IBuildImageInAzureContext } from "./IBuildImageInAzureContext";
export class OSPickStep extends AzureWizardPromptStep<IBuildImageInAzureContext> {
public async prompt(context: IBuildImageInAzureContext): Promise<void> {
const placeHolder: string = localize('imageOSPrompt', 'Select image base OS');
const picks: IAzureQuickPickItem<'Windows' | 'Linux'>[] = [
{ label: 'Linux', data: 'Linux', suppressPersistence: true },
{ label: 'Windows', data: 'Windows', suppressPersistence: true },
];
context.os = (await context.ui.showQuickPick(picks, { placeHolder })).data;
}
public shouldPrompt(context: IBuildImageInAzureContext): boolean {
return !context.os;
}
}