husky hook does not work #981
Copy link
Copy link
Open
Description
This part of README has this:
"husky": {
"hooks": {
"prepare-commit-msg": "exec < /dev/tty && npx cz --hook || true"
}
}But this hook does not work. When I use git commit - I get default behavior
If I put this in .husky/prepare-commit-msg:
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
exec < /dev/tty && npx cz --hook || true
And run git commit it works but after commitizen I see result commit in nano. How to fix this?

Reacted by Luiza Marlene, Gual Casas and Amanda dos Santos Felix
Metadata
Metadata
Assignees
Labels
No labels
Activity
FreePhoenix888 commentedon Sep 4, 2023
@chenaski @pen4
dwhoban commentedon Sep 11, 2023
Related to #934
muratgozel commentedon Sep 8, 2024
@FreePhoenix888 make sure to have husky hooks are executable:
chmod u+x ./.husky/prepare-commit-msgrferraztech commentedon Jan 14, 2025
Same here.
chmod u+x ./.husky/prepare-commit-msgdoesn't work