From 7ecb4ac32cabc86f2e526bb561e127fb28c4e261 Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Tue, 7 Nov 2017 11:29:46 -0800 Subject: [PATCH] Remove node dependency --- bin/node.bat | 6 ++++++ bin/node.sh | 2 ++ src/cloudConsole.ts | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100755 bin/node.bat create mode 100755 bin/node.sh diff --git a/bin/node.bat b/bin/node.bat new file mode 100755 index 0000000..6a63cde --- /dev/null +++ b/bin/node.bat @@ -0,0 +1,6 @@ +@echo off +setlocal +set ELECTRON_NO_ASAR=1 +set ELECTRON_RUN_AS_NODE=1 +%* +endlocal diff --git a/bin/node.sh b/bin/node.sh new file mode 100755 index 0000000..1fb572a --- /dev/null +++ b/bin/node.sh @@ -0,0 +1,2 @@ +#!/bin/bash +ELECTRON_NO_ASAR=1 ELECTRON_RUN_AS_NODE=1 "$@" \ No newline at end of file diff --git a/src/cloudConsole.ts b/src/cloudConsole.ts index ad835d9..b26f524 100644 --- a/src/cloudConsole.ts +++ b/src/cloudConsole.ts @@ -60,15 +60,15 @@ export function openCloudConsole(api: AzureAccount, os: OS) { // TODO: How to update the access token when it expires? const isWindows = process.platform === 'win32'; - const shellPath = isWindows ? 'node.exe' : 'node'; let modulePath = path.join(__dirname, 'cloudConsoleLauncher'); if (isWindows) { modulePath = modulePath.replace(/\\/g, '\\\\'); } window.createTerminal({ name: localize('azure-account.cloudConsole', "Cloud Shell"), - shellPath, // process.argv0, // TODO + shellPath: path.join(__dirname, `../../bin/node.${isWindows ? 'bat' : 'sh'}`), shellArgs: [ + process.argv0, '-e', `require('${modulePath}').main()`, ],