diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index b3d9af6ad80e9699270c39b48914b4d1fea5abb3..b6b01d18ef21567a12f39a331b8825bfee3460d1 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -271,7 +271,7 @@ function prepareDebPackage(arch) { var packageRevision = '1'; return function () { - var shortcut = gulp.src('resources/common/bin/code.sh', { base: '.' }) + var shortcut = gulp.src('resources/linux/bin/code.sh', { base: '.' }) .pipe(rename(function (p) { p.extname = ''; p.dirname = 'usr/bin'; })); var desktop = gulp.src('resources/linux/debian/code.desktop', { base: '.' }) diff --git a/resources/common/bin/code.sh b/resources/linux/bin/code.sh similarity index 62% rename from resources/common/bin/code.sh rename to resources/linux/bin/code.sh index b0841e098621d87a1ae1af754418291009e7c436..13405efe6fec2f64a7cdd8160023a04a4a35f1b8 100755 --- a/resources/common/bin/code.sh +++ b/resources/linux/bin/code.sh @@ -5,16 +5,14 @@ VSCODE_DIR="/usr/share/code" if [ -x "$VSCODE_DIR/Code" ]; then - ELECTRON_FILE="Code" + ELECTRON="$VSCODE_DIR/Code" elif [ -x "$VSCODE_DIR/Code - OSS" ]; then - ELECTRON_FILE="Code - OSS" + ELECTRON="$VSCODE_DIR/Code - OSS" else echo "Could not locate Visual Studio Code executable." exit 1 fi -VSCODE_LAUNCHER="$VSCODE_DIR/resources/app/out/cli.js" - -ELECTRON_RUN_AS_NODE=1 VSCODE_PATH="$VSCODE_DIR/$ELECTRON_FILE" \ - "$VSCODE_DIR/$ELECTRON_FILE" $VSCODE_LAUNCHER "$@" +CLI="$VSCODE_DIR/resources/app/out/cli.js" +ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@" exit $? diff --git a/src/vs/workbench/electron-main/cli.ts b/src/vs/workbench/electron-main/cli.ts index e066aae50aff363c6347397d7cb6751b29a381e8..c04cccf0caad001db32bbf37a85c9fda157d744d 100644 --- a/src/vs/workbench/electron-main/cli.ts +++ b/src/vs/workbench/electron-main/cli.ts @@ -46,7 +46,7 @@ export function main(argv: string[]) { console.log(packageJson.version); } else { delete process.env['ELECTRON_RUN_AS_NODE']; - spawn(process.env['VSCODE_PATH'], process.argv.slice(2), { detached: true, stdio: 'ignore' }); + spawn(process.execPath, process.argv.slice(2), { detached: true, stdio: 'ignore' }); } process.exit(0);