From f4f5c63290c2a9f0f7a0d17876038b86337dd2a1 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 10 Aug 2026 05:26:08 +0000 Subject: [PATCH] =?UTF-8?q?v3.1:=20=E4=BF=AE=E5=A4=8D=E5=AE=98=E6=96=B9?= =?UTF-8?q?=E8=A3=85=E5=99=A8=E5=8F=82=E6=95=B0(--yes=20=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8,=20=E6=94=B9=20--no-prompt=20--no-onboard)=20+=20?= =?UTF-8?q?=E8=A1=A5=E5=9B=9E=E8=A2=AB=E8=AF=AF=E5=88=A0=E7=9A=84=20node?= =?UTF-8?q?=5Fmajor/openclaw=5Flocal=5Fversion/openclaw=5Fremote=5Fversion?= =?UTF-8?q?/npm=5Finstall=5Fopenclaw?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index e297997..056a1c0 100755 --- a/install.sh +++ b/install.sh @@ -354,6 +354,28 @@ node_major() { printf '%s' "${v%%.*}" } +node_major() { + node -v 2>/dev/null | sed 's/^v//' | cut -d. -f1 +} + +openclaw_local_version() { + npm list -g openclaw --depth=0 --no-update-notifier 2>/dev/null \ + | grep openclaw | awk '{print $NF}' | sed 's/^.*@//' +} + +openclaw_remote_version() { + npm view openclaw version --no-update-notifier 2>/dev/null +} + +npm_install_openclaw() { + info "正在执行 npm install -g openclaw@latest(首次安装可能需要几分钟)…" + if run_quiet npm install -g openclaw@latest --no-update-notifier; then + return 0 + fi + warn "首次安装失败,重试一次…" + run_quiet npm install -g openclaw@latest --no-update-notifier +} + install_node() { title "安装 Node.js 与 OpenClaw(官方安装器)" info "调用官方安装器 https://openclaw.ai/install.sh" @@ -375,8 +397,8 @@ install_node() { die "官方安装器内容异常(不是脚本)。" "可能被网络劫持,请检查网络环境后重试。" fi - _log "RUN: bash official install.sh --yes" - if bash "$tmp_inst" --yes 2>&1 | tee -a "$LOG_FILE"; then + _log "RUN: bash official install.sh --no-prompt" + if bash "$tmp_inst" --no-prompt --no-onboard 2>&1 | tee -a "$LOG_FILE"; then ok "官方安装器执行完成" else warn "官方安装器返回非零状态,继续检查实际安装结果。"