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
+9
View File
@@ -10,6 +10,15 @@
---
## 1.8.2 — 修 update.sh 在 `curl | bash` 下崩潰(bash 3.2 多位元組字元,1.7.0 漏修到的同類 bug)
1.7.0 修了 install.sh 的「多位元組字元旁變數要用 `${VAR}` 包」,但 update.sh 第 54 行漏網:
`已是最新版($LOCAL_VER` 的中文全形括號緊貼裸變數 `$LOCAL_VER``curl | bash` 串流在多位元組
邊界切斷時,bash 3.2 把後續位元組誤當變數名 → `LOCAL_VER: unbound variable` 崩潰。偏偏觸發點在
「本機版本=遠端版本」分支,所以「以為沒更新、再跑一次」必中。
- 第 54-55 行 `$LOCAL_VER``${LOCAL_VER}`。已用 bash `set -u` 模擬該分支驗證不再崩。
## 1.8.1 — 補裝 Cowork 的 wiki skill`docs/SKILL.md`+ CLAUDE.md 加 wiki/gloss 導航
發現 Coworkclaude.ai)整理 wiki 的規則檔 `docs/SKILL.md`(含 typed-edge、frontmatter 標籤、**gloss****從來沒被安裝到用戶端**install.sh 沒下載它,連 `template/docs/` 發佈源都缺這檔 → claude.ai 來掃時身上沒任何 wiki 規則。同時 CC 平時讀的 CLAUDE.md 沒指向採集規則,導致「CC 說找不到 gloss 指引」。這版把兩條路徑都補上。
+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 ""
+1 -1
View File
@@ -1 +1 @@
1.8.1
1.8.2