add code launcher for windows bash

fixes #1704
This commit is contained in:
Joao Moreno 2016-02-25 16:53:28 +01:00
parent bc579fa55e
commit 1a51948f9c
2 changed files with 18 additions and 5 deletions

View file

@ -230,12 +230,14 @@ function packageTask(platform, arch, opts) {
.pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version']));
if (platform === 'win32') {
var shortcutFilter = filter('bin/*.cmd', { restore: true });
result = es.merge(result, gulp.src('sources/win32/bin/code.js', { base: 'resources/win32' }));
result = es.merge(result, gulp.src('resources/win32/bin/**', { base: 'resources/win32' }))
.pipe(shortcutFilter)
.pipe(rename(function (f) { f.basename = product.applicationName; }))
.pipe(shortcutFilter.restore);
result = es.merge(result, gulp.src('sources/win32/bin/code.cmd', { base: 'resources/win32' })
.pipe(rename(function (f) { f.basename = product.applicationName; })));
result = es.merge(result, gulp.src('sources/win32/bin/code.sh', { base: 'resources/win32' })
.pipe(replace('@@NAME@@', product.nameShort))
.pipe(rename(function (f) { f.basename = product.applicationName; f.extname = ''; })));
}
return result.pipe(symdest(destination));

View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
NAME="@@NAME@@"
VSCODE_PATH="$(dirname "$(dirname "$(realpath "$0")")")"
ELECTRON="$VSCODE_PATH/$NAME.exe"
CLI="$VSCODE_PATH/resources/app/out/cli.js"
ELECTRON_NO_ATTACH_CONSOLE=1 ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
exit $?