Hi — thanks for this package.
It turns out it does not work if the directory structure is not the one assumed by pre-commit. Specifically, it seems to assume that git root is path.resolve(__dirname, '..', '..') which might not be the case (as it happens in our setup). A safer way to get the root would be git rev-parse --show-toplevel. If folks agree, I can submit a pull request.
(A smaller, but related, problem is that the install.js script fails silently in this case — i.e., without providing any feedback on where to start from. Without any message, just the effort of understanding how pre-commit works to fix this problem might be more than the effort of just setting the pre-commit hook manually; thus, adding a short message would bring significant benefits.)
Hi — thanks for this package.
It turns out it does not work if the directory structure is not the one assumed by
pre-commit. Specifically, it seems to assume that git root ispath.resolve(__dirname, '..', '..')which might not be the case (as it happens in our setup). A safer way to get the root would begit rev-parse --show-toplevel. If folks agree, I can submit a pull request.(A smaller, but related, problem is that the
install.jsscript fails silently in this case — i.e., without providing any feedback on where to start from. Without any message, just the effort of understanding howpre-commitworks to fix this problem might be more than the effort of just setting the pre-commit hook manually; thus, adding a short message would bring significant benefits.)