Open temple opened 7 years ago
Hello temple.
Right! This would be a great feature to have! Actually, this was the initial idea for this module. However, .git
folder is not versioned by git
by default while I found putting the commands to execute when pulling in package.json
not only can be versioned automatically but also being able to invoke non-global devDependencies to have portability.
I have put this on my TODO list. I am still busy working on something at this moment. Hopefully, this can be implemented in the next 30 days.
Thanks for your idea!
I think reading both from package.json
and .git/hooks/pre-pull
and execute them in this order would be good.
As a tip.
When I installed git-pull-hook via npm install -g git-pull-hook
, and I run gitp
for the first time, it did'nt suggest me to create a package.json
file, and neither told me where to get a sample one.
First user reaction may be taking a look at it git/hooks folder, cause shouldn't be concious of the need of having a package.json
file.
I think more clever way to develop this enhancement, may imply advising the user via console.log
to deploy this files when none was found.
Thanks
So, edbc29f added notification for hook that is not found. However, it doesn't say whether package.json
is found because I will add support for .git/hooks
soon.
Thanks for your advice.
Once looked at the code, it seem to read from
package.json
the user defined hooks. https://github.com/yxliang01/git-pull-hook/blob/master/src/index.js#L78But, the "git way" is to deploy script files under
.git/hooks
directory, as explained here https://git-scm.com/book/en/v2/Customizing-Git-Git-HooksIt would be a nice feature, and I suggest doing two things:
package.json
when looking for hook scriptsREADME.md
for those people whom don't know how to read code ;)