You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.)
The text was updated successfully, but these errors were encountered:
It turns out that he master branch is behind the one published on npm. I run version ^1.2.2, but when cloning to fix, I see someone has already added code that is not reflected on npm — it's still not the full solution, but it does include a nice error message.
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.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 howpre-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.)The text was updated successfully, but these errors were encountered: