From e097c02b9dae8f2a172a218b564f821b3887d5f0 Mon Sep 17 00:00:00 2001 From: richblack Date: Fri, 26 Jun 2026 15:27:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=201.8.x=20=E8=88=8A=E8=85=B3?= =?UTF-8?q?=E6=9C=AC=E5=8D=87=E7=B4=9A=E6=92=9E=20404=20+=20VERSION=20?= =?UTF-8?q?=E8=A2=AB=E6=B1=A1=E6=9F=93=20+=20bump=201.9.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.9.0 把 VERSION 搬到 system-dev/,但 1.8.x 舊用戶本機 update.sh 寫死抓舊路徑, curl 對 404 把「404:NotFound」當內容寫進 VERSION,且第一次跑不遷移。 - 發佈源保留相容墊片 template/.claude/VERSION(與 system-dev/VERSION 同步) - 新 update.sh 驗 REMOTE_VER 須像 X.Y.Z,否則視為取不到,永不寫進 VERSION (404/HTML/空 全擋,未來路徑變動也不會再污染版號) 照 README curl main/scripts/update.sh 升級者抓遠端新腳本、一次遷移不受影響; 只有跑本機舊 scripts/update.sh 才中,這版修掉。 Co-Authored-By: Claude Opus 4.8 (1M context) --- CHANGELOG.md | 8 ++++++++ scripts/update.sh | 6 ++++++ template/.claude/VERSION | 1 + template/system-dev/VERSION | 2 +- 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 template/.claude/VERSION diff --git a/CHANGELOG.md b/CHANGELOG.md index 35a9dda..325589c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,14 @@ --- +## 1.9.1 — 修舊版(1.8.x)升級到 1.9.0 撞 404 + VERSION 被污染 + +1.9.0 把 VERSION 從 `template/.claude/VERSION` 搬到 `template/system-dev/VERSION`,但 1.8.x 舊用戶**本機的** update.sh 寫死抓舊路徑 → `curl` 對 404 會把「404: Not Found」當內容回傳(非空),舊腳本沒驗證就把它寫進 `.claude/VERSION`,畫面顯示 `Latest version: 404:NotFound`、且第一次跑不會遷移(要再跑一次)。 + +- **發佈源保留相容墊片** `template/.claude/VERSION`:讓 1.8.x 舊腳本仍抓得到版號、不再 404。(bump 時與 `system-dev/VERSION` 同步) +- **新版 update.sh 加版號格式驗證**:`REMOTE_VER` 必須像 `X.Y.Z`,否則(404 字串/HTML 錯誤頁/空)一律視為「取不到」,永不寫進 VERSION。未來任何路徑變動都不會再污染版號檔。 +- 提醒:照 README 那行 `curl … main/scripts/update.sh | bash` 升級的人本就抓遠端新腳本、一次遷移成功不受影響;只有手動跑**本機舊** `bash scripts/update.sh` 才會遇到,這版一併修掉。 + ## 1.9.0 — 安裝結構收進 `system-dev/`(不再污染用戶根目錄)+ 舊版自動遷移 工具產物原本散在用戶根目錄(`docs/` 七層、update 時的 `scripts/`),又把 `wiki/`、`VERSION` 寄生在 CC 原生的 `.claude/` 裡,用戶分不清「哪個 docs 是工具的、哪個是我的」。這版徹底收斂:除了 CC 死綁的 `.claude/`(settings/commands/hooks)和 `CLAUDE.md` 留根,**工具所有資料收進 `system-dev/`**。對應 SDD:`system-dev/docs/3-specs/install-layout/`。 diff --git a/scripts/update.sh b/scripts/update.sh index 210e8b6..d0fa318 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -41,6 +41,12 @@ elif [ -f ".claude/VERSION" ]; then LOCAL_VER="$(tr -d '[:space:]' < .claude/VERSION)" fi REMOTE_VER="$(curl -sSL "$TEMPLATE_URL/system-dev/VERSION" 2>/dev/null | tr -d '[:space:]' || echo '')" +# 容錯:curl 對 404 會把「404:NotFound」當內容輸出(非空),舊版誤把它寫進 VERSION。 +# 這裡驗證必須像版號(X.Y.Z),否則一律視為取不到,避免污染 VERSION 檔。 +case "$REMOTE_VER" in + [0-9]*.[0-9]*.[0-9]*) : ;; # 形如 1.9.0 → 合法 + *) REMOTE_VER="" ;; # 404 / HTML 錯誤頁 / 其他 → 當作沒抓到 +esac echo "" echo "🔄 system-dev-template updater" diff --git a/template/.claude/VERSION b/template/.claude/VERSION new file mode 100644 index 0000000..ee672d8 --- /dev/null +++ b/template/.claude/VERSION @@ -0,0 +1 @@ +1.9.1 \ No newline at end of file diff --git a/template/system-dev/VERSION b/template/system-dev/VERSION index abb1658..ee672d8 100644 --- a/template/system-dev/VERSION +++ b/template/system-dev/VERSION @@ -1 +1 @@ -1.9.0 \ No newline at end of file +1.9.1 \ No newline at end of file