Skip to content

Does not find correct root. #150

@nvasilakis

Description

@nvasilakis

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions