-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathDockerFileItemStep.ts
More file actions
20 lines (17 loc) · 1.15 KB
/
DockerFileItemStep.ts
File metadata and controls
20 lines (17 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { AzureWizardPromptStep } from '@microsoft/vscode-azext-utils';
import { DOCKERFILE_GLOB_PATTERN } from "../../../constants";
import { localize } from '../../../utils/localize';
import { selectWorkspaceFile } from "../../../utils/workspaceUtils";
import { IBuildImageInAzureContext } from "./IBuildImageInAzureContext";
export class DockerFileItemStep extends AzureWizardPromptStep<IBuildImageInAzureContext> {
public async prompt(context: IBuildImageInAzureContext): Promise<void> {
context.dockerFilePath = await selectWorkspaceFile(context, localize('dockerFilePick', 'Select a Dockerfile'), { filters: { 'Dockerfile': ['Dockerfile', 'Dockerfile.*'] } }, DOCKERFILE_GLOB_PATTERN);
}
public shouldPrompt(context: IBuildImageInAzureContext): boolean {
return !context.dockerFilePath;
}
}