Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/ci/build/code-server.sh

36 lines
800 B
Bash
Raw Normal View History

#!/bin/sh
set -eu
2020-05-27 16:39:17 -04:00
# This script is intended to be bundled into the standalone releases.
# Runs code-server with the bundled node binary.
2020-02-25 16:20:47 -06:00
_realpath() {
if [ "$(uname)" = "Linux" ]; then
readlink -f "$1"
return
fi
# See https://github.com/cdr/code-server/issues/1537
if [ "$(uname)" = "Darwin" ]; then
script="$1"
if [ -L "$script" ]; then
while [ -L "$script" ]; do
# We recursively read the symlink, which may be relative from $script.
script="$(readlink "$script")"
cd "$(dirname "$script")"
done
else
cd "$(dirname "$script")"
fi
echo "$PWD/$(basename "$script")"
return
fi
echo "Unsupported OS $(uname)" >&2
exit 1
2020-04-22 17:45:53 -04:00
}
2020-02-25 16:20:47 -06:00
ROOT="$(dirname "$(dirname "$(_realpath "$0")")")"
2020-05-28 00:49:37 -04:00
exec "$ROOT/lib/node" "$ROOT" "$@"