refactor: jsc-herdr 技能改名,herdr 改為 cmd、gitea-issue 改為 gitea

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
root
2026-10-14 04:50:49 +00:00
co-authored by Claude Sonnet 5.5
parent 5701b8b8e5
commit 346cbbad2c
16 changed files with 18 additions and 18 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# 用法:tick.sh <owner/repo> <N> <第幾項>
# 把議題內文第 k 個核取方塊(已勾的也算在內)改成「[x]」。每次都重新讀取最新內文再改。
source "$(dirname "$0")/lib.sh"
REPO="${1:?}"; N="${2:?}"; K="${3:?用法:tick.sh <owner/repo> <N> <第幾項>}"
NEW="$(issue_json "$REPO" "$N" | python3 -c "
import sys,json,re
body=json.load(sys.stdin)['body']
k=int(sys.argv[1]); i=[0]
def rep(m):
i[0]+=1
return '[x]' if i[0]==k else m.group(0)
out=re.sub(r'\[[ xX]\]', rep, body)
if i[0]<k: sys.exit('只有 %d 個核取方塊,沒有第 %d 個' % (i[0],k))
sys.stdout.write(out)
" "$K")"
tea issues edit "$N" --repo "$REPO" --description "$NEW" >/dev/null
echo "#$N 第 $K 項已勾選,剩 $(grep -o '\[ \]' <<<"$NEW" | wc -l) 項"