Cleanup modified hooks after npm uninstall
vitalets opened this issue ยท 8 comments
I'm using ghooks for several projects but for one project I decided to uninstall it.
After npm un ghooks
I'm getting error on every commit:
ghooks not found!
Make sure you have it installed on your "node_modules".
Skipping git hooks.
Is it possible to cleanup modified hooks automatically?
thx!
I just delete my .git/hooks
directory. I wonder if there's an uninstall
script that we could use...
Yes, sure i can do it.
But maybe it's better to keep hooks/*.sample
for the future.
I end up with the following command that removes all hooks not ending with .sample
:
cd .git/hooks
ls | grep \.sample -v | xargs rm
I think it could be useful to add uninstall
section to readme.
I think it'd be even better to add a postuninstall
script in our npm scripts
just like we have an install
script.
Would you like to makeapullrequest.com? Make sure that it works on windows too!
Also run into this one.
I definitely just recommend switching to husky: #166
@kentcdodds after 7 months of husky perhaps you could share your experiences as to how it works under the scenario described in the OP?
Honestly, this is never really something I notice. But I'm pretty sure that husky uninstalls properly IIRC.
Thanks Kent, will keep that in consideration. For now the messaging in place should suffice. Pulls welcome.