Skip to content

Commit be4a1ef

Browse files
committed
add darwin specific launcher
1 parent 76465f3 commit be4a1ef

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

build/gulpfile.vscode.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ function packageTask(platform, arch, opts) {
238238
all = es.merge(all, gulp.src('resources/win32/code_file.ico', { base: '.' }));
239239
} else if (platform === 'linux') {
240240
all = es.merge(all, gulp.src('resources/linux/code.png', { base: '.' }));
241+
} else if (platform === 'darwin') {
242+
var shortcut = gulp.src('resources/darwin/bin/code.sh')
243+
.pipe(rename('bin/code'));
244+
245+
all = es.merge(all, shortcut);
241246
}
242247

243248
var result = all

resources/darwin/bin/code.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
6+
function realpath() { python -c "import os,sys; print os.path.realpath(sys.argv[1])" "$0"; }
7+
CONTENTS="$(dirname "$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")")"
8+
ELECTRON="$CONTENTS/MacOS/Electron"
9+
CLI="$CONTENTS/Resources/app/out/cli.js"
10+
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
11+
exit $?

0 commit comments

Comments
 (0)