Guard FORCE_NODE_VERSION in the version error path (#7983)

Installing on the wrong node version dies with "FORCE_NODE_VERSION: unbound
variable" instead of explaining itself. The script runs under set -u and
this is the one place the variable is read bare; the three other reads all
default it.
This commit is contained in:
denusklo
2026-09-05 02:46:24 +08:00
committed by GitHub
parent 2b2f8b3d5c
commit 11699e6cd7

View File

@@ -67,7 +67,7 @@ main() {
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-24}" ]; then
echo "ERROR: code-server currently requires node v24."
if [ -n "$FORCE_NODE_VERSION" ]; then
if [ -n "${FORCE_NODE_VERSION:-}" ]; then
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
fi
echo "We have detected that you are on node v$major_node_version"