提交 13f70045 编写于 作者: J Joao Moreno

remove VSCODE_PATH from cli, move to linux

上级 ef931f2e
...@@ -271,7 +271,7 @@ function prepareDebPackage(arch) { ...@@ -271,7 +271,7 @@ function prepareDebPackage(arch) {
var packageRevision = '1'; var packageRevision = '1';
return function () { 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'; })); .pipe(rename(function (p) { p.extname = ''; p.dirname = 'usr/bin'; }));
var desktop = gulp.src('resources/linux/debian/code.desktop', { base: '.' }) var desktop = gulp.src('resources/linux/debian/code.desktop', { base: '.' })
......
...@@ -5,16 +5,14 @@ ...@@ -5,16 +5,14 @@
VSCODE_DIR="/usr/share/code" VSCODE_DIR="/usr/share/code"
if [ -x "$VSCODE_DIR/Code" ]; then if [ -x "$VSCODE_DIR/Code" ]; then
ELECTRON_FILE="Code" ELECTRON="$VSCODE_DIR/Code"
elif [ -x "$VSCODE_DIR/Code - OSS" ]; then elif [ -x "$VSCODE_DIR/Code - OSS" ]; then
ELECTRON_FILE="Code - OSS" ELECTRON="$VSCODE_DIR/Code - OSS"
else else
echo "Could not locate Visual Studio Code executable." echo "Could not locate Visual Studio Code executable."
exit 1 exit 1
fi fi
VSCODE_LAUNCHER="$VSCODE_DIR/resources/app/out/cli.js" CLI="$VSCODE_DIR/resources/app/out/cli.js"
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
ELECTRON_RUN_AS_NODE=1 VSCODE_PATH="$VSCODE_DIR/$ELECTRON_FILE" \
"$VSCODE_DIR/$ELECTRON_FILE" $VSCODE_LAUNCHER "$@"
exit $? exit $?
...@@ -46,7 +46,7 @@ export function main(argv: string[]) { ...@@ -46,7 +46,7 @@ export function main(argv: string[]) {
console.log(packageJson.version); console.log(packageJson.version);
} else { } else {
delete process.env['ELECTRON_RUN_AS_NODE']; 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); process.exit(0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册