shared-git-hooks icon indicating copy to clipboard operation
shared-git-hooks copied to clipboard

fail gracefully in git-less env

Open mattkime opened this issue 8 years ago • 2 comments

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.

mattkime avatar Nov 18 '16 02:11 mattkime

noted and makes sense. do you have time for a PR ?

kilianc avatar Nov 23 '16 08:11 kilianc

I ended up using https://github.com/typicode/husky instead which already supports this

mattkime avatar Nov 23 '16 12:11 mattkime