Skip to content

Commit

Permalink
Add boolean for zipDeploy (#37)
Browse files Browse the repository at this point in the history
* Add boolean for zipDeploy
  • Loading branch information
nturinski authored Dec 5, 2017
1 parent 3c691cd commit 29e629c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion appservice/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vscode-azureappservice",
"author": "Microsoft Corporation",
"version": "0.7.0",
"version": "0.7.1",
"description": "Common tools for developing Azure App Service extensions for VS Code",
"tags": [
"azure",
Expand Down
14 changes: 8 additions & 6 deletions appservice/src/SiteWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ export class SiteWrapper {
outputChannel.appendLine(localize('DeleteSucceeded', 'Successfully deleted "{0}".', this.appName));
}

public async deploy(fsPath: string, client: WebSiteManagementClient, outputChannel: vscode.OutputChannel): Promise<void> {
public async deploy(fsPath: string, client: WebSiteManagementClient, outputChannel: vscode.OutputChannel, confirmDeployment: boolean = true): Promise<void> {
const config: SiteConfigResource = await this.getSiteConfig(client);
switch (config.scmType) {
case 'LocalGit':
await this.localGitDeploy(fsPath, client, outputChannel);
break;
default:
await this.deployZip(fsPath, client, outputChannel);
await this.deployZip(fsPath, client, outputChannel, confirmDeployment);
break;
}
}
Expand Down Expand Up @@ -193,10 +193,12 @@ export class SiteWrapper {
return await this.updateScmType(client, config, newScmType);
}

private async deployZip(fsPath: string, client: WebSiteManagementClient, outputChannel: vscode.OutputChannel): Promise<void> {
const warning: string = localize('zipWarning', 'Are you sure you want to deploy to "{0}"? This will overwrite any previous deployment and cannot be undone.', this.appName);
if (await vscode.window.showWarningMessage(warning, DialogResponses.yes, DialogResponses.cancel) !== DialogResponses.yes) {
throw new UserCancelledError();
private async deployZip(fsPath: string, client: WebSiteManagementClient, outputChannel: vscode.OutputChannel, confirmDeployment: boolean): Promise<void> {
if (confirmDeployment) {
const warning: string = localize('zipWarning', 'Are you sure you want to deploy to "{0}"? This will overwrite any previous deployment and cannot be undone.', this.appName);
if (await vscode.window.showWarningMessage(warning, DialogResponses.yes, DialogResponses.cancel) !== DialogResponses.yes) {
throw new UserCancelledError();
}
}

outputChannel.show();
Expand Down

0 comments on commit 29e629c

Please sign in to comment.