Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
How to make Husky run git hook? I have a working git hook, prepare-commit-message, but the moment Husky was installed, the hook stopped working. Not finding much luck, I then tried to make it a "H...
#1: Initial revision
How to make Husky run git hook?
How to make Husky run git hook? I have a working git hook, prepare-commit-message, but the moment Husky was installed, the hook stopped working. Not finding much luck, I then tried to make it a "Husky git hook" and run it like that, so I installed it via `npx husky add prepare-commit-message content`, but this did not help. Summary of the situation: 1. git hook on it's own - works 2. two other husky git hooks - work on their own (pre-commit, pre-push) 3. `git config -e` and hooksPath set as `.husky` 4. my script as a husky hook, installed like above - makes commit-related two Husky hooks no longer work. `git commit` never happens, instead pre-commit hook fails with a message that > .husky/pre-commit: 2: .: cannot open .husky/husky.sh: No such file or, if I move `pre-commit` one out: > .husky/prepare-commit-msg: 8: .: cannot open .husky/_/husky.sh: No such file However, interestingly, if I _REMOVE_ the config bit about `.husky` dir, `git commit` opens normally, but without what I'd expect from `prepare-commit-message`. At this point I'm kind of stumped, so any help is welcome.