Closed zayne-wang closed 2 months ago
Thank you for the PR. Actually files in .husky/_/
are owned by husky and shouldn't be edited. That's why they get replaced.
User hooks needs to be in .husky/
. For example, if you create .husky/pre-commit
it won't be replaced.
@typicode Thanks for an awesome tool!
User hooks needs to be in .husky/. For example, if you create .husky/pre-commit it won't be replaced.
This does not match what I'm seeing with husky 9.0.11. I have my own .husky/pre-commit
file with custom commands. When I run npx husky init
this file gets overwritten with the default npm test
again.
I wonder if this is a bug, or some kind of misunderstanding?
Thanks for the kind words :)
Some kind of misunderstanding. husky init
is an automatic setup and should be run once (like npm init
or git init
for example).
fix: fix the issue #1387