fix push bug when no workspace is opened in vscode (#140)

This commit is contained in:
Sheng Chen 2018-03-13 13:46:46 +08:00 коммит произвёл GitHub
Родитель ae3cf071f8
Коммит 94c18004e2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -1,5 +1,6 @@
"use strict";
import * as _ from "lodash";
import * as vscode from "vscode";
import { TelemetryWrapper } from "vscode-extension-telemetry-wrapper";
import { BaseShell } from "./baseShell";
@ -69,6 +70,10 @@ export async function activate(ctx: vscode.ExtensionContext) {
ctx.subscriptions.push(TelemetryWrapper.registerCommand("azureTerraform.push", async () => {
if (terminalSetToCloudshell()) {
if (_.isEmpty(vscode.workspace.workspaceFolders)) {
vscode.window.showInformationMessage("Please open a workspace in VS Code first.");
return;
}
const tfFiles: vscode.Uri[] = await vscode.workspace.findFiles(filesGlobSetting());
await cloudShell.pushFiles(tfFiles);
} else {