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