2020-02-26 01:20:47 +03:00
|
|
|
#!/usr/bin/env sh
|
2020-04-23 00:45:53 +03:00
|
|
|
# Runs code-server with the bundled Node binary.
|
2020-02-26 01:20:47 +03:00
|
|
|
|
2020-04-23 00:45:53 +03:00
|
|
|
# More complicated than readlink -f or realpath to support macOS.
|
|
|
|
# See https://github.com/cdr/code-server/issues/1537
|
|
|
|
get_installation_dir() {
|
|
|
|
# We read the symlink, which may be relative from $0.
|
|
|
|
dst="$(readlink "$0")"
|
|
|
|
# We cd into the $0 directory.
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
# Now we can cd into the dst directory.
|
|
|
|
cd "$(dirname "$dst")"
|
|
|
|
# Finally we use pwd -P to print the absolute path of the directory of $dst.
|
|
|
|
pwd -P
|
|
|
|
}
|
2020-02-26 01:20:47 +03:00
|
|
|
|
2020-04-23 00:45:53 +03:00
|
|
|
dir=$(get_installation_dir)
|
2020-03-06 19:31:16 +03:00
|
|
|
exec "$dir/node" "$dir/out/node/entry.js" "$@"
|