fix(release-check): brace-delimit $VAR before full-width parens (set -u unbound var crash)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
uncle6me-web
2026-06-10 17:31:28 +08:00
parent 2ff51f00ca
commit 8346596ceb
+5 -5
View File
@@ -49,7 +49,7 @@ if git rev-parse --git-dir >/dev/null 2>&1; then
err "$BRANCH 領先 origin/$BRANCH $AHEAD 個 commit 未 push → **deploy 前先 git push**(否則 self-hosted 裝到舊 worker,重演壓測階段 6 的 seed 404)" err "$BRANCH 領先 origin/$BRANCH $AHEAD 個 commit 未 push → **deploy 前先 git push**(否則 self-hosted 裝到舊 worker,重演壓測階段 6 的 seed 404)"
GIT_BLOCK=1 GIT_BLOCK=1
else else
warn "$BRANCH vs origin/$BRANCHahead=$AHEAD behind=$BEHIND(確認狀態)" warn "${BRANCH} vs origin/${BRANCH}ahead=${AHEAD} behind=${BEHIND}(確認狀態)"
fi fi
else else
info "非 git repo,跳過 git 同步檢查" info "非 git repo,跳過 git 同步檢查"
@@ -77,7 +77,7 @@ fi
if [ "$LOCAL_CLI" = "$REMOTE_CLI" ]; then if [ "$LOCAL_CLI" = "$REMOTE_CLI" ]; then
ok "CLI 版本同步:本機 $LOCAL_CLI = npm $REMOTE_CLI" ok "CLI 版本同步:本機 $LOCAL_CLI = npm $REMOTE_CLI"
elif [ "$REMOTE_CLI" = "無法查線上" ] || [ "$REMOTE_CLI" = "無 npm CLI 可查" ]; then elif [ "$REMOTE_CLI" = "無法查線上" ] || [ "$REMOTE_CLI" = "無 npm CLI 可查" ]; then
info "本機 CLI $LOCAL_CLI$REMOTE_CLI" info "本機 CLI ${LOCAL_CLI}${REMOTE_CLI}"
else else
warn "CLI 版本漂移:本機 $LOCAL_CLI ≠ npm $REMOTE_CLI" warn "CLI 版本漂移:本機 $LOCAL_CLI ≠ npm $REMOTE_CLI"
warn "→ 跑 scripts/local-deploy.sh(含 cli/ 變動時)會 npm publish;或手動 cd cli && npm publish" warn "→ 跑 scripts/local-deploy.sh(含 cli/ 變動時)會 npm publish;或手動 cd cli && npm publish"
@@ -88,7 +88,7 @@ if git rev-parse --git-dir >/dev/null 2>&1; then
LAST_CLI_PKG_CHANGE=$(git log -1 --format=%h -- cli/package.json 2>/dev/null || echo "") LAST_CLI_PKG_CHANGE=$(git log -1 --format=%h -- cli/package.json 2>/dev/null || echo "")
LAST_CLI_SRC_CHANGE=$(git log -1 --format=%h -- cli/src 2>/dev/null || echo "") LAST_CLI_SRC_CHANGE=$(git log -1 --format=%h -- cli/src 2>/dev/null || echo "")
if [ -n "$LAST_CLI_SRC_CHANGE" ] && [ "$LAST_CLI_SRC_CHANGE" != "$LAST_CLI_PKG_CHANGE" ]; then if [ -n "$LAST_CLI_SRC_CHANGE" ] && [ "$LAST_CLI_SRC_CHANGE" != "$LAST_CLI_PKG_CHANGE" ]; then
info "cli/src 最後變動($LAST_CLI_SRC_CHANGE)晚於 package.json$LAST_CLI_PKG_CHANGE)→ 確認是否需 bump version" info "cli/src 最後變動(${LAST_CLI_SRC_CHANGE})晚於 package.json${LAST_CLI_PKG_CHANGE})→ 確認是否需 bump version"
fi fi
fi fi
@@ -100,7 +100,7 @@ if command -v curl >/dev/null 2>&1; then
if [ "$CODE" = "200" ]; then if [ "$CODE" = "200" ]; then
ok "https://cypher.arcrun.dev/health → 200" ok "https://cypher.arcrun.dev/health → 200"
else else
warn "https://cypher.arcrun.dev/health → $CODE(部署中或不可達?)" warn "https://cypher.arcrun.dev/health → ${CODE}(部署中或不可達?)"
fi fi
else else
info "無 curl,跳過線上健康檢查" info "無 curl,跳過線上健康檢查"
@@ -111,7 +111,7 @@ echo ""
echo "【MCP serverarcrun/mcp/,已進主庫)】" echo "【MCP serverarcrun/mcp/,已進主庫)】"
if [ -d mcp ] && [ -f mcp/wrangler.toml ]; then if [ -d mcp ] && [ -f mcp/wrangler.toml ]; then
MCP_NAME=$(grep '^name' mcp/wrangler.toml | head -1 | sed -E 's/^name[[:space:]]*=[[:space:]]*"([^"]*)".*/\1/') MCP_NAME=$(grep '^name' mcp/wrangler.toml | head -1 | sed -E 's/^name[[:space:]]*=[[:space:]]*"([^"]*)".*/\1/')
ok "arcrun/mcp/ 存在(worker: $MCP_NAME);由 local-deploy.sh 一併 wrangler deploy" ok "arcrun/mcp/ 存在(worker: ${MCP_NAME});由 local-deploy.sh 一併 wrangler deploy"
info "薄殼一致性:MCP 工具集應對齊 cypher-executor 最新 APIrule 07" info "薄殼一致性:MCP 工具集應對齊 cypher-executor 最新 APIrule 07"
info "用戶連哪台 MCP 由 .mcp.json 決定(acr mcp-setup 依 config mcp_url 產)" info "用戶連哪台 MCP 由 .mcp.json 決定(acr mcp-setup 依 config mcp_url 產)"
else else