refactor: 技能統一收進 jsc-skills,加入 herdr,版本統一為 0.0.1
- 新增 jsc-skills plugin,含 herdr、herdr-issue、ingest,以 /jsc-skills:<名稱> 呼叫 - ingest 自 companion 移入,移除獨立的 herdr-issue plugin - companion 版本由 0.0.3 改為 0.0.1 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
6ae82d1889
commit
26fbf9ae30
+18
@@ -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) 項"
|
||||
Reference in New Issue
Block a user