-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy pathcreateNewProjectWithDockerfile.ts
More file actions
33 lines (28 loc) · 1.79 KB
/
createNewProjectWithDockerfile.ts
File metadata and controls
33 lines (28 loc) · 1.79 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
27
28
29
30
31
32
33
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { AzureWizard, type IActionContext } from "@microsoft/vscode-azext-utils";
import { localize } from "../../../localize";
import { createActivityContext } from "../../../utils/activityUtils";
import { FolderListStep } from "../FolderListStep";
import { type IProjectWizardContext } from "../IProjectWizardContext";
import { OpenBehaviorStep } from "../OpenBehaviorStep";
import { OpenFolderStep } from "../OpenFolderStep";
import { CreateDockerfileProjectStep } from "./CreateDockerfileProjectStep";
import { DockerfileProjectLanguageStep } from "./DockefileProjectLanguageStep";
import { type IDockerfileProjectContext } from "./IDockerfileProjectContext";
export async function createNewProjectWithDockerfile(context: IActionContext): Promise<void> {
const wizardContext: Partial<IDockerfileProjectContext> & Partial<IProjectWizardContext> & IActionContext = {
...context,
...(await createActivityContext())
}
const wizard: AzureWizard<IDockerfileProjectContext> = new AzureWizard(wizardContext, {
title: localize('createNewProject', 'Create new project with dockerfile'),
promptSteps: [new FolderListStep(), new DockerfileProjectLanguageStep(), new OpenBehaviorStep()],
executeSteps: [new CreateDockerfileProjectStep(), new OpenFolderStep()]
});
wizardContext.activityTitle = localize('createNewDockerfileProject', 'Create new project with dockerfile');
await wizard.prompt();
await wizard.execute();
}