





















@@ -1047,7 +1047,7 @@ Options:
10471047 --install-method, --method npm|git Install via npm (default) or from a git checkout
10481048 --npm Shortcut for --install-method npm
10491049 --git, --github Shortcut for --install-method git
1050- --version <version|dist-tag|spec> npm install target (default: latest; use "main" for GitHub main)
1050+ --version <version|dist-tag|spec> npm install target (default: latest)
10511051 --beta Use beta if available, else latest
10521052 --git-dir, --dir <path> Checkout directory (default: ~/openclaw)
10531053 --no-git-update Skip git pull for existing checkout
@@ -1060,7 +1060,7 @@ Options:
1060106010611061Environment variables:
10621062 OPENCLAW_INSTALL_METHOD=git|npm
1063- OPENCLAW_VERSION=latest|next|main|<semver>|<spec>
1063+ OPENCLAW_VERSION=latest|next|<semver>|<spec>
10641064 OPENCLAW_BETA=0|1
10651065 OPENCLAW_GIT_DIR=...
10661066 OPENCLAW_GIT_UPDATE=0|1
@@ -1076,7 +1076,7 @@ Examples:
10761076 curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash
10771077 curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --no-onboard
10781078 curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --no-onboard --verify
1079- curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --version main
1079+ curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --install-method git --version main
10801080 curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --install-method git --no-onboard
10811081EOF
10821082}
@@ -2444,6 +2444,23 @@ is_explicit_package_install_spec() {
24442444 [[ "$value" == *"://"* || "$value" == *"#"* || "$value" =~ ^(file|github|git\+ssh|git\+https|git\+http|git\+file|npm): ]]
24452445}
244624462447+is_openclaw_source_package_install_spec() {
2448+local value="${1:-}"
2449+local normalized_value=""
2450+ normalized_value="$(to_lowercase_ascii "$value")"
2451+ normalized_value="${normalized_value#openclaw@}"
2452+2453+ [[ "$normalized_value" == "main" ]] && return 0
2454+ [[ "$normalized_value" =~ ^github:openclaw/openclaw($|[#/]) ]] && return 0
2455+2456+ normalized_value="${normalized_value#git+}"
2457+ [[ "$normalized_value" =~ ^https?://github\.com/openclaw/openclaw(\.git)?($|[?#]) ]] && return 0
2458+ [[ "$normalized_value" =~ ^ssh://git@github\.com[:/]openclaw/openclaw(\.git)?($|[?#]) ]] && return 0
2459+ [[ "$normalized_value" =~ ^git://github\.com/openclaw/openclaw(\.git)?($|[?#]) ]] && return 0
2460+ [[ "$normalized_value" =~ ^git@github\.com:openclaw/openclaw(\.git)?($|[?#]) ]] && return 0
2461+return 1
2462+}
2463+24472464can_resolve_registry_package_version() {
24482465local value="${1:-}"
24492466local normalized_value=""
@@ -2499,6 +2516,12 @@ install_openclaw() {
24992516 OPENCLAW_VERSION="latest"
25002517fi
250125182519+if is_openclaw_source_package_install_spec "${OPENCLAW_VERSION}"; then
2520+ ui_error "npm installs do not support OpenClaw GitHub source targets like '${OPENCLAW_VERSION}'."
2521+ ui_info "Use --install-method git --version main for the moving main checkout, or use latest, beta, an exact version, or a built .tgz package."
2522+return 1
2523+fi
2524+25022525local resolved_version=""
25032526if can_resolve_registry_package_version "${OPENCLAW_VERSION}"; then
25042527 resolved_version="$(npm view "${package_name}@${OPENCLAW_VERSION}" version 2>/dev/null || true)"
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。