mirror of
https://github.com/jnMetaCode/superpowers-zh.git
synced 2026-09-02 22:54:06 +08:00
fix: 同步上游两处纯代码修复(Windows hook 分发 + find-polluter 路径匹配)
对齐上游 v6.1.1 -> v6.2.0 时挑出的两处「无需翻译、无需 eval」的修复。 两个文件在我们这边都与上游 v6.1.1 字节一致(从未汉化改动),所以可直接取上游版。 1) hooks/hooks.json 加 "shell": "bash"(上游 5151e7a) SessionStart hook 在 Windows 上原先不经 Git Bash 分发。我们的 hooks.json 与上游 除这一行外完全相同。这条直接改善 Windows 用户的 bootstrap 可靠性 —— 而 bootstrap 不加载 skill 就是死重。 冒烟测试:CLAUDE_PLUGIN_ROOT 指向仓库跑 run-hook.cmd session-start, 退出码 0,输出正确的 SessionStart JSON(含中文 using-superpowers 正文)。 2) skills/systematic-debugging/find-polluter.sh 取上游修复版(上游 6015d37、c8921b5) 修三个真 bug,已逐个实测新旧版对比: - pattern 带 ./ 前缀时匹配不到(find . 输出 ./ 前缀路径):旧 1 个 -> 新 2 个 - -path 的 **/ 无法匹配零层目录,src/**/*.test.ts 漏掉 src/top.test.ts: 旧 1 个 -> 新 2 个 - 完全无匹配时计数为 1 而非 0(echo 空串仍算一行):旧 1 -> 新 0 验证:audit.sh 153 pass / 0 fail、verify-release.sh 82 pass / 0 fail。 注:audit 的上游漂移 warn 从 2 条变 3 条(新增 using-git-worktrees), 且 executing-plans / finishing-a-development-branch 的上游 H 值有变化 —— 这是本次 git fetch upstream 把对比基准从旧快照更新到 v6.2.0 导致的, 不是本提交的改动引起。三个 SKILL.md 本提交都没碰。漂移详情见 #19。
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
{
|
||||
"type": "command",
|
||||
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start",
|
||||
"shell": "bash",
|
||||
"async": false
|
||||
}
|
||||
]
|
||||
|
||||
@@ -18,9 +18,18 @@ echo "🔍 Searching for test that creates: $POLLUTION_CHECK"
|
||||
echo "Test pattern: $TEST_PATTERN"
|
||||
echo ""
|
||||
|
||||
# Get list of test files
|
||||
TEST_FILES=$(find . -path "$TEST_PATTERN" | sort)
|
||||
TOTAL=$(echo "$TEST_FILES" | wc -l | tr -d ' ')
|
||||
# Get list of test files (find . emits ./-prefixed paths, so accept the
|
||||
# pattern written with or without a leading ./)
|
||||
TEST_PATTERN="${TEST_PATTERN#./}"
|
||||
# find -path can't match '**/' against zero directory levels, so a pattern
|
||||
# like src/**/*.test.ts would skip src/top.test.ts; also try the pattern
|
||||
# with '**/' collapsed to cover files directly under the base directory.
|
||||
TEST_FILES=$(find . \( -path "./$TEST_PATTERN" -o -path "./${TEST_PATTERN//\*\*\//}" \) | sort -u)
|
||||
if [ -z "$TEST_FILES" ]; then
|
||||
TOTAL=0
|
||||
else
|
||||
TOTAL=$(printf '%s\n' "$TEST_FILES" | wc -l | tr -d ' ')
|
||||
fi
|
||||
|
||||
echo "Found $TOTAL test files"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user