code server scripts: use realpath

This commit is contained in:
Martin Aeschlimann 2022-02-01 17:24:14 +01:00
parent d971263085
commit 884273e35b
No known key found for this signature in database
GPG key ID: 2609A01E695523E3
3 changed files with 15 additions and 2 deletions

View file

@ -329,7 +329,7 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
.pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(rename(`bin/helpers/browser.sh`))
.pipe(util.setExecutableBit()),
gulp.src('resources/server/bin/code-server.sh', { base: '.' })
gulp.src(`resources/server/bin/${platform === 'darwin' ? 'code-server-darwin.sh' : 'code-server-linux.sh'}`, { base: '.' })
.pipe(rename(`bin/${product.serverApplicationName}`))
.pipe(util.setExecutableBit())
);

View file

@ -0,0 +1,13 @@
#!/usr/bin/env sh
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
case "$1" in
--inspect*) INSPECT="$1"; shift;;
esac
function realpath() { python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$0"; }
ROOT=$(dirname $(dirname $(realpath "$0")))
"$ROOT/node" ${INSPECT:-} "$ROOT/out/server-main.js" "$@"

View file

@ -7,6 +7,6 @@ case "$1" in
--inspect*) INSPECT="$1"; shift;;
esac
ROOT=$(dirname "$(dirname "$0")")
ROOT=$(dirname $(dirname $(readlink -f $0)))
"$ROOT/node" ${INSPECT:-} "$ROOT/out/server-main.js" "$@"