diff --git a/src/azureHelpers.ts b/src/azureHelpers.ts index d88c4a3..abe5950 100644 --- a/src/azureHelpers.ts +++ b/src/azureHelpers.ts @@ -3,6 +3,7 @@ import * as vscode from 'vscode'; import { Constants } from './constants'; import * as utilities from './utilities'; +var https = require('https'); export class AzureHelpers { constructor() { @@ -23,8 +24,6 @@ export class AzureHelpers { } // XXX - check if credentials are valid - - var https = require('https'); let __this = this; let postData: string = "resource=https%3A%2F%2Fmanagement.core.windows.net%2F&client_id=" + azure_client_id + "&grant_type=client_credentials&client_secret=" + azure_secret; diff --git a/src/dockerRunner.ts b/src/dockerRunner.ts index 4946391..deda9f6 100644 --- a/src/dockerRunner.ts +++ b/src/dockerRunner.ts @@ -10,6 +10,7 @@ import { TelemetryClient } from './telemetryClient'; import { clearInterval } from 'timers'; import { TerminalBaseRunner } from './terminalBaseRunner'; import * as fsExtra from 'fs-extra'; +import * as child_process from 'child_process'; export class DockerRunner extends TerminalBaseRunner { @@ -105,7 +106,7 @@ export class DockerRunner extends TerminalBaseRunner { private startTerminal(terminalId: string, initCmd: string, terminalName: string, waitAfterInit: boolean, subCmds: string[], interval: number, reuse: boolean): void { TerminalExecutor.runInTerminal(initCmd, terminalName, waitAfterInit, subCmds, interval, reuse, function (terminal, interval) { if (terminal) { - require('child_process').exec('docker ps --filter name=' + terminalId, (err, stdout, stderr) => { + child_process.exec('docker ps --filter name=' + terminalId, (err, stdout, stderr) => { if (err || stderr) { console.log('err: ' + err + ' ' + stderr); return; diff --git a/src/restSamples.ts b/src/restSamples.ts index bab3231..9226c86 100644 --- a/src/restSamples.ts +++ b/src/restSamples.ts @@ -6,6 +6,7 @@ import { PlaybookManager } from './playbookManager'; import * as utilities from './utilities'; var path = require("path"); var fs = require('fs'); +var clone = require('git-clone'); var pm = new PlaybookManager(); export class RestSamples { @@ -91,7 +92,6 @@ export class RestSamples { const progress = utilities.delayedInterval(() => { this._outputChannel.append('.') }, 500); this._outputChannel.append("Getting Azure REST API specifications."); - let clone = require('git-clone'); //let home: string = path.join(vscode.extensions.getExtension("vscoss.vscode-ansible").extensionPath, 'azure-rest-api-specs'); let home = path.join(process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'], '.vscode', 'rest'); clone("https://github.com/Azure/azure-rest-api-specs.git", home, null, (result) => { diff --git a/src/utilities.ts b/src/utilities.ts index 1c978a1..f203ec2 100644 --- a/src/utilities.ts +++ b/src/utilities.ts @@ -13,12 +13,13 @@ import { SSHServer } from './interfaces'; import * as scp from 'scp2'; import { clearInterval } from 'timers'; import * as ssh from 'ssh2'; +import * as childprocess from 'child_process'; const sshConfigFile = path.join(os.homedir(), '.ssh', 'servers.json'); export function localExecCmd(cmd: string, args: string[], outputChannel: vscode.OutputChannel, cb: Function): void { try { - var cp = require('child_process').spawn(cmd, args); + var cp = childprocess.spawn(cmd, args); cp.stdout.on('data', function (data) { if (outputChannel) {