-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy pathCreateDockerfileProjectStep.ts
More file actions
26 lines (21 loc) · 1.22 KB
/
CreateDockerfileProjectStep.ts
File metadata and controls
26 lines (21 loc) · 1.22 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
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ext } from "@microsoft/vscode-azext-serviceconnector";
import { AzureWizardExecuteStep, nonNullValueAndProp } from "@microsoft/vscode-azext-utils";
import { cpUtils } from "../../../utils/cpUtils";
import { type IFunctionWizardContext } from "../../createFunction/IFunctionWizardContext";
export class CreateDockerfileProjectStep extends AzureWizardExecuteStep<IFunctionWizardContext>{
public priority: number = 100;
public async execute(context: IFunctionWizardContext): Promise<void> {
let language = nonNullValueAndProp(context, 'language').toLowerCase();
if (language === 'c#') {
language = 'csharp';
}
await cpUtils.executeCommand(ext.outputChannel, nonNullValueAndProp(context, 'projectPath'), "func", "init", "--worker-runtime", language, "--docker");
}
public shouldExecute(): boolean {
return true;
}
}