fix: update.sh 在 curl|bash 下崩潰(bash 3.2 多位元組,1.7.0 漏修)+ bump 1.8.2

第 54 行「已是最新版($LOCAL_VER)」中文全形括號緊貼裸變數,curl|bash 串流在
多位元組邊界切斷時 bash 3.2 誤判變數名 → LOCAL_VER�: unbound variable。觸發點
在「本機=遠端版本」分支,故「以為沒更新再跑一次」必中。

- $LOCAL_VER → ${LOCAL_VER}(同 1.7.0 install.sh 的修法,當時漏掉 update.sh)
- bash set -u 模擬該分支驗過不再崩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-26 14:41:06 +08:00
parent e0ff006564
commit c95705c286
3 changed files with 12 additions and 3 deletions
+2 -2
View File
@@ -51,8 +51,8 @@ if [ -z "$REMOTE_VER" ]; then
fi
if [ "$LOCAL_VER" = "$REMOTE_VER" ]; then
t "✅ 已是最新版($LOCAL_VER),不需更新。" \
"✅ Already up to date ($LOCAL_VER), nothing to update."
t "✅ 已是最新版(${LOCAL_VER}),不需更新。" \
"✅ Already up to date (${LOCAL_VER}), nothing to update."
t " (仍會同步模板邏輯檔,確保 hooks/commands 與最新一致。)" \
" (Template logic files will still be synced to keep hooks/commands in line with the latest.)"
echo ""