kazazor / git-pre-commit

A pre-commit hook that ignores all the unstagged changes while performing the pre-commit command you wrote (Using Shell, Gulp, Grunt etc..)
https://www.npmjs.com/package/git-pre-commit
MIT License
18 stars 5 forks source link

Feature request. Client files are not in project root #37

Open bhjertaas opened 7 years ago

bhjertaas commented 7 years ago

Perhaps I am wrong, but it looks to me that it is not possible to use 'git-pre-commit' on git projects that do not have the package.json and gulpfile in the same directory as the git root of that project. For example a project like this, where we have server (Java) files in project root, and a client folder for frontent stuff.

ProjectDir
     .git
     client
          package.json

Would it be possible to add a config option to inform 'git-pre-commit' where to find the package.json file, or perhaps it could search subfolders until it located the package.json file?

Let me know if this sounds interesting, and I will consider making a pull request.

LjiljanaMatic commented 7 years ago

Any progress on this? I am having the same issue and it seems that git-pre-commit is only npm package that will run only for staged files