fix(meta): 版本號改為單位數進位
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env sh
|
||||
# sync-skill-manifest.sh — 同步 domain 的 README「Skills 目錄」區塊,並把該 domain 所有
|
||||
# plugin manifest 的 version 各 bump 一個 patch。
|
||||
# plugin manifest 的 version 各 bump 一次,且每個數字都不超過 9。
|
||||
#
|
||||
# 用法: sync-skill-manifest.sh <domain-path>
|
||||
#
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# manifest: 依序找出 domain 下存在的 plugin.json、.claude-plugin/plugin.json、
|
||||
# .codex-plugin/plugin.json,version 一律 bump 成同一個新值(以第一份找到的 manifest 版本為準,
|
||||
# patch 位加一;major.minor 不變)。
|
||||
# 右側數字加一,滿 9 就往左進位;任何一位都不超過 9)。
|
||||
#
|
||||
# 輸出: 變更摘要——README 新增/移除的技能小節、各 manifest 的舊版本 -> 新版本。
|
||||
set -eu
|
||||
@@ -151,7 +151,25 @@ old=$(sed -n 's/.*"version": *"\([^"]*\)".*/\1/p' "$first" | head -1)
|
||||
major=$(printf '%s' "$old" | cut -d. -f1)
|
||||
minor=$(printf '%s' "$old" | cut -d. -f2)
|
||||
patch=$(printf '%s' "$old" | cut -d. -f3)
|
||||
new="$major.$minor.$((patch + 1))"
|
||||
|
||||
major=$((major + 0))
|
||||
minor=$((minor + 0))
|
||||
patch=$((patch + 1))
|
||||
while [ "$patch" -gt 9 ]; do
|
||||
patch=$((patch - 10))
|
||||
minor=$((minor + 1))
|
||||
done
|
||||
while [ "$minor" -gt 9 ]; do
|
||||
minor=$((minor - 10))
|
||||
major=$((major + 1))
|
||||
done
|
||||
|
||||
if [ "$major" -gt 9 ]; then
|
||||
echo "版本已超出三位單數字可表示範圍: $old" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
new="$major.$minor.$patch"
|
||||
|
||||
echo "== manifest version =="
|
||||
for m in $MANIFESTS; do
|
||||
|
||||
Reference in New Issue
Block a user