fix(installer): reject invalid shell options

This commit is contained in:
Vincent Koc
2026-05-26 08:41:47 +02:00
parent 3b023e9bdb
commit 6c5b39291f
4 changed files with 63 additions and 1 deletions
+15
View File
@@ -255,19 +255,31 @@ parse_args() {
shift
;;
--prefix)
if [[ $# -lt 2 || "${2:-}" == --* ]]; then
fail "Missing value for $1"
fi
PREFIX="$2"
shift 2
;;
--version)
if [[ $# -lt 2 || "${2:-}" == --* ]]; then
fail "Missing value for $1"
fi
OPENCLAW_VERSION="$2"
shift 2
;;
--node-version)
if [[ $# -lt 2 || "${2:-}" == --* ]]; then
fail "Missing value for $1"
fi
NODE_VERSION="$2"
NODE_VERSION_REQUESTED=1
shift 2
;;
--install-method|--method)
if [[ $# -lt 2 || "${2:-}" == --* ]]; then
fail "Missing value for $1"
fi
INSTALL_METHOD="$2"
shift 2
;;
@@ -280,6 +292,9 @@ parse_args() {
shift
;;
--git-dir|--dir)
if [[ $# -lt 2 || "${2:-}" == --* ]]; then
fail "Missing value for $1"
fi
GIT_DIR="$2"
shift 2
;;