beads/cmd
matt wilkie bc613d8aaa
fix(hooks): sanitize husky hooks when copied into beads-managed dir (GH#3132) (#3208)
When `bd init` chains existing husky hooks into `.beads/hooks/`, it
blindly copied per-hook files whose `. "$(dirname "$0")/_/husky.sh"`
(v8) or `. "$(dirname "$0")/h"` (v9) source line dangles in the new
location. Result: v8 commits fail loudly with `husky.sh: No such file
or directory`; v9 commits silently no-op because husky's dispatcher
resolves to `.beads/<hook>` (does not exist) and exits 0, skipping all
of the user's lint-staged / formatter / etc. commands.

Detect husky source dirs and rewrite hook bodies to drop the helper
source line, injecting `node_modules/.bin` on PATH so `npx` and
project-local binaries continue to resolve. Skip copying husky's `h`
and `husky.sh` dispatchers, which are no longer needed once hooks are
inlined.
2026-04-12 14:45:43 -07:00
..
bd fix(hooks): sanitize husky hooks when copied into beads-managed dir (GH#3132) (#3208) 2026-04-12 14:45:43 -07:00