shared-git-hooks
shared-git-hooks copied to clipboard
fail gracefully in git-less env
I'm attempting to use this in a project but its failing in git-less environments which include
- Docker builds (files, incl. package.json are copied into the docker image)
- travis / ci (could install git to fix this but that would be kind of gross)
in the situation where git is not installed AND there's no .git dir, it would be nice if this failed gracefully.
PROPOSAL -
check which git and check for a .git dir. if both come up empty then fail gracefully.
This looks pretty easy to implement. Would need to take some time to understand how the tests work.
noted and makes sense. do you have time for a PR ?
I ended up using https://github.com/typicode/husky instead which already supports this