Skip to content

Commit

Permalink
Show 'creating' node for new app services
Browse files Browse the repository at this point in the history
  • Loading branch information
ejizba committed Nov 29, 2017
1 parent b60ab96 commit 63a7d01
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
8 changes: 6 additions & 2 deletions appservice/src/createAppService/createFunctionApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ import { Memento, OutputChannel } from 'vscode';
import { AppKind, WebsiteOS } from './AppKind';
import { AppServiceCreator } from './AppServiceCreator';

export async function createFunctionApp(outputChannel: OutputChannel, persistence: Memento, credentials?: ServiceClientCredentials, subscription?: Subscription): Promise<Site | undefined> {
export async function createFunctionApp(outputChannel: OutputChannel, persistence: Memento, credentials?: ServiceClientCredentials, subscription?: Subscription, showCreatingNode?: (label: string) => void): Promise<Site | undefined> {
const creator: AppServiceCreator = new AppServiceCreator(outputChannel, persistence, AppKind.functionapp, WebsiteOS.windows, credentials, subscription);
await creator.run();
await creator.prompt();
if (showCreatingNode) {
showCreatingNode(creator.websiteNameStep.websiteName);
}
await creator.execute();
return creator.siteStep.site;
}
8 changes: 6 additions & 2 deletions appservice/src/createAppService/createWebApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ import { Memento, OutputChannel } from 'vscode';
import { AppKind, WebsiteOS } from './AppKind';
import { AppServiceCreator } from './AppServiceCreator';

export async function createWebApp(outputChannel: OutputChannel, persistence: Memento, credentials?: ServiceClientCredentials, subscription?: Subscription): Promise<Site | undefined> {
export async function createWebApp(outputChannel: OutputChannel, persistence: Memento, credentials?: ServiceClientCredentials, subscription?: Subscription, showCreatingNode?: (label: string) => void): Promise<Site | undefined> {
const creator: AppServiceCreator = new AppServiceCreator(outputChannel, persistence, AppKind.app, WebsiteOS.linux, credentials, subscription);
await creator.run();
await creator.prompt();
if (showCreatingNode) {
showCreatingNode(creator.websiteNameStep.websiteName);
}
await creator.execute();
return creator.siteStep.site;
}
6 changes: 3 additions & 3 deletions appservice/src/wizard/WizardBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ export abstract class WizardBase {
this.persistence = persistence;
}

public async run(): Promise<void> {
// Go through the prompts...
public async prompt(): Promise<void> {
for (const step of this._steps) {
try {
await step.prompt();
} catch (err) {
this.onError(<Error>err, step);
}
}
}

public async execute(): Promise<void> {
this._outputChannel.show(true);
// Execute each step...
for (const step of this._steps) {
try {
await step.execute();
Expand Down

0 comments on commit 63a7d01

Please sign in to comment.