fix(install): normalize null hook matcher → "" on merge (Claude Code /doctor)
Users with pre-kit hooks that have no `matcher` field end up with matcher:null,
which Claude Code /doctor rejects ("Expected string, but received null") and
skips the whole settings file. The jq merge preserved null as-is, so every
reinstall re-surfaced the error. Now map(.matcher //= "") before group_by →
null/absent collapses to "" (match-all), one group per matcher.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9866d716d7
commit
d89ddf0c74
1 changed files with 4 additions and 0 deletions
|
|
@ -60,6 +60,10 @@ _jq_merge_hooks() {
|
|||
| reduce ($add.hooks | keys[]) as $phase ($orig;
|
||||
.hooks[$phase] = (
|
||||
((.hooks[$phase] // []) + ($add.hooks[$phase] // []))
|
||||
# Normalize null/absent matcher → "" (Claude Code /doctor rejects null;
|
||||
# user's pre-kit hooks often have no matcher field). Before group_by so
|
||||
# null + "" collapse into one group.
|
||||
| map(.matcher //= "")
|
||||
| group_by(.matcher)
|
||||
| map(
|
||||
.[0].matcher as $m
|
||||
|
|
|
|||
Loading…
Reference in a new issue