未验证 提交 ab081cd5 编写于 作者: A Anmol Sethi

Add warning when using outdated code-server script

上级 e2789608
......@@ -5,31 +5,32 @@ set -eu
# Runs code-server with the bundled node binary.
_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")"
# See https://github.com/cdr/code-server/issues/1537 on why no realpath or readlink -f.
script="$1"
cd "$(dirname "$script")"
while [ -L "$(basename "$script")" ]; do
if [ -L "./node" ] && [ -L "./code-server" ] &&
[ -f "package.json" ] &&
cat package.json | grep -q '^ "name": "code-server",$'; then
echo "***** Please use the script in bin/code-server instead!" >&2
echo "***** This script will soon be removed!" >&2
echo "***** See the release notes at https://github.com/cdr/code-server/releases/tag/v3.4.0" >&2
fi
echo "$PWD/$(basename "$script")"
return
fi
script="$(readlink "$(basename "$script")")"
cd "$(dirname "$script")"
done
echo "$PWD/$(basename "$script")"
}
echo "Unsupported OS $(uname)" >&2
exit 1
root() {
script="$(_realpath "$0")"
bin_dir="$(dirname "$script")"
echo "$(dirname "$bin_dir")"
}
ROOT="$(dirname "$(dirname "$(_realpath "$0")")")"
ROOT="$(root)"
exec "$ROOT/lib/node" "$ROOT" "$@"
......@@ -9,7 +9,7 @@ main() {
tsc --noEmit
# See comment in ./ci/image/debian8
if [[ ! ${CI-} ]]; then
shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090 $(git ls-files "*.sh")
shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files "*.sh")
fi
}
......
FROM centos:7
RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash - && \
yum install -y nodejs && \
npm install -g yarn
RUN ARCH="$(uname -m | sed 's/86_64/64/; s/aarch64/arm64/')" && \
curl -fsSL "https://nodejs.org/dist/v14.4.0/node-v14.4.0-linux-$ARCH.tar.xz" | tar -C /usr/local -xJ && \
mv /usr/local/node-v14.4.0-linux-$ARCH /usr/local/node-v14.4.0
ENV PATH=/usr/local/node-v14.4.0/bin:$PATH
RUN npm install -g yarn
RUN yum groupinstall -y 'Development Tools'
RUN yum install -y python2 libsecret-devel libX11-devel libxkbfile-devel
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册