From c95705c286112bf8bdaf91cfc9c69e819cb810ec Mon Sep 17 00:00:00 2001 From: richblack Date: Fri, 26 Jun 2026 14:41:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20update.sh=20=E5=9C=A8=20curl|bash=20?= =?UTF-8?q?=E4=B8=8B=E5=B4=A9=E6=BD=B0(bash=203.2=20=E5=A4=9A=E4=BD=8D?= =?UTF-8?q?=E5=85=83=E7=B5=84,1.7.0=20=E6=BC=8F=E4=BF=AE)+=20bump=201.8.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 第 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) --- CHANGELOG.md | 9 +++++++++ scripts/update.sh | 4 ++-- template/.claude/VERSION | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b52ec63..674b9aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 導航 發現 Cowork(claude.ai)整理 wiki 的規則檔 `docs/SKILL.md`(含 typed-edge、frontmatter 標籤、**gloss**)**從來沒被安裝到用戶端**:install.sh 沒下載它,連 `template/docs/` 發佈源都缺這檔 → claude.ai 來掃時身上沒任何 wiki 規則。同時 CC 平時讀的 CLAUDE.md 沒指向採集規則,導致「CC 說找不到 gloss 指引」。這版把兩條路徑都補上。 diff --git a/scripts/update.sh b/scripts/update.sh index fc72ad6..4961c2b 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -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 "" diff --git a/template/.claude/VERSION b/template/.claude/VERSION index b9268da..0bfbd57 100644 --- a/template/.claude/VERSION +++ b/template/.claude/VERSION @@ -1 +1 @@ -1.8.1 \ No newline at end of file +1.8.2 \ No newline at end of file