-
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.12 KB
/
DockerFileItemStep.ts
File metadata and controls
20 lines (17 loc) · 1.12 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 type { 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_GLOB_PATTERN);
}
public shouldPrompt(context: IBuildImageInAzureContext): boolean {
return !context.dockerfilePath;
}
}