remove useless code (#102)
This commit is contained in:
Родитель
913c767795
Коммит
12f417fddf
|
@ -1,6 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
import * as vscode from "vscode";
|
||||
import { TFTerminal } from "./shared";
|
||||
import { terraformChannel } from "./terraformChannel";
|
||||
|
||||
|
@ -12,35 +11,10 @@ export abstract class BaseShell {
|
|||
this.initShellInternal();
|
||||
}
|
||||
|
||||
public runTerraformCmd(tfCommand: string, workingDir: string): void {
|
||||
|
||||
// We keep the TFConfiguration for the moment - will need to be updated to sync folders
|
||||
const tfActiveFile = vscode.window.activeTextEditor ? vscode.window.activeTextEditor.document.fileName : null;
|
||||
terraformChannel.appendLine(`Running - ${tfCommand}, Active File: ${tfActiveFile}`);
|
||||
|
||||
// Run Terraform command
|
||||
this.runTerraformInternal(tfCommand, workingDir);
|
||||
|
||||
}
|
||||
|
||||
public async runTerraformCmdAsync(tfCommand: string): Promise<any> {
|
||||
const tfActiveFile = vscode.window.activeTextEditor ? vscode.window.activeTextEditor.document.fileName : null;
|
||||
terraformChannel.appendLine(`Running - ${tfCommand}`);
|
||||
terraformChannel.show();
|
||||
|
||||
return this.runTerraformAsyncInternal(tfActiveFile, tfCommand);
|
||||
}
|
||||
public abstract runTerraformCmd(tfCommand: string, workingDir: string);
|
||||
|
||||
public abstract runTerraformTests(testType: string, workingDirectory: string);
|
||||
|
||||
protected output(label: string, message: string): void {
|
||||
terraformChannel.appendLine(`[${label}] ${message}`);
|
||||
}
|
||||
|
||||
protected outputLine(label: string, message: string): void {
|
||||
terraformChannel.appendLine(`[${label}] ${message}`);
|
||||
}
|
||||
|
||||
protected isWindows(): boolean {
|
||||
return process.platform === "win32";
|
||||
}
|
||||
|
@ -54,7 +28,5 @@ export abstract class BaseShell {
|
|||
}
|
||||
}
|
||||
|
||||
protected abstract runTerraformInternal(tfCommand: string, workingDir: string);
|
||||
protected abstract runTerraformAsyncInternal(tfConfiguration: string, tfCommand: string): void;
|
||||
protected abstract initShellInternal();
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ export class CloudShell extends BaseShell {
|
|||
|
||||
}
|
||||
|
||||
protected async runTerraformInternal(TFCommand: string, WorkDir: string): Promise<void> {
|
||||
public async runTerraformCmd(tfCommand: string, workingDir: string): Promise<void> {
|
||||
// Workaround the TLS error
|
||||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
|
||||
// TODO: Check if logged with azure account
|
||||
|
@ -125,9 +125,9 @@ export class CloudShell extends BaseShell {
|
|||
this.tfTerminal.storageAccountKey = terminal[3];
|
||||
this.tfTerminal.fileShareName = terminal[4];
|
||||
this.tfTerminal.ResourceGroup = terminal[5];
|
||||
await this.runTFCommand(TFCommand, WorkDir, this.tfTerminal.terminal);
|
||||
await this.runTFCommand(tfCommand, workingDir, this.tfTerminal.terminal);
|
||||
} else {
|
||||
await this.runTFCommand(TFCommand, WorkDir, this.tfTerminal.terminal);
|
||||
await this.runTFCommand(tfCommand, workingDir, this.tfTerminal.terminal);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -142,10 +142,6 @@ export class CloudShell extends BaseShell {
|
|||
});
|
||||
}
|
||||
|
||||
protected runTerraformAsyncInternal(TFConfiguration: string, TFCommand: string): void {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected async startCloudShell(): Promise<Terminal> {
|
||||
const accountAPI: AzureAccount = vscode.extensions
|
||||
.getExtension<AzureAccount>("ms-vscode.azure-account")!.exports;
|
||||
|
|
|
@ -111,6 +111,13 @@ export class IntegratedShell extends BaseShell {
|
|||
}
|
||||
}
|
||||
|
||||
public runTerraformCmd(tfCommand: string, workingDir: string): void {
|
||||
this.checkCreateTerminal();
|
||||
const term = this.tfTerminal.terminal;
|
||||
term.show();
|
||||
term.sendText(tfCommand);
|
||||
}
|
||||
|
||||
protected initShellInternal() {
|
||||
this.tfTerminal = new TFTerminal(TerminalType.Integrated, Constants.TerraformTerminalName);
|
||||
vscode.window.onDidCloseTerminal((terminal) => {
|
||||
|
@ -121,24 +128,6 @@ export class IntegratedShell extends BaseShell {
|
|||
});
|
||||
}
|
||||
|
||||
protected runTerraformInternal(TFCommand: string, WorkDir: string): void {
|
||||
this.checkCreateTerminal();
|
||||
const term = this.tfTerminal.terminal;
|
||||
term.show();
|
||||
term.sendText(TFCommand);
|
||||
return;
|
||||
}
|
||||
|
||||
protected runTerraformAsyncInternal(TFConfiguration: string, TFCommand: string): void {
|
||||
this.checkCreateTerminal();
|
||||
|
||||
const term = this.tfTerminal.terminal;
|
||||
|
||||
term.show();
|
||||
|
||||
term.sendText(TFCommand);
|
||||
}
|
||||
|
||||
private async deletePng(cwd: string): Promise<void> {
|
||||
const graphPath: string = path.join(cwd, IntegratedShell.GRAPH_FILE_NAME);
|
||||
if (await fse.pathExists(graphPath)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче