tarmolov / git-hooks-js

A tool to manage and run project git hooks
167 stars 30 forks source link

Use git rev-parse --git-dir to find a git dir #57

Open rjmunro opened 6 years ago

rjmunro commented 6 years ago

Inspired by @Kampfgnom's work, but using execSync to simplify things a lot.

This fixes #48, meaning that hooks will be installed if the project is a submodule.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-1.08%) to 97.872% when pulling 4b1ac7ca6dd87c24deb60613a56d435921a17154 on rjmunro:feature/parse-git-dir into f7e9bd5b00a0b79b831b5383ba88e9446eb1cd82 on tarmolov:master.

rjmunro commented 6 years ago

@tarmolov This should be ready to merge. It's failing coveralls because it adds one more uncovered line, which is a throw statement that happens if there is an unknown error. I don't know how to fake the kind of error, so I can't write tests for it. Something like git not being installed, or trying to install in a folder that doesn't exist might do it - I'm not sure.