Reputation: 542
Inside git hook folder, I have pre push file inside it i am running "npm run coverage" i.e. command for unit test coverage.
git-hook > pre-push > npm run coverage
but it is not working, can somebody please help me.
Upvotes: 7
Views: 9395
Reputation: 1591
check .git/hooks. If it's empty try to uninstall husky and install again. my sh history
ls .git/hooks
npm uninstall husky
npm i husky -D
ls .git/hooks
it helped me
Upvotes: 3
Reputation: 30868
pre-push
(not pre-push.sh
, not pre-push.py
, precisely pre-push
, with no file extension)..git/hooks/
. If you have set core.hooksPath=xxx
in the config, make sure it's under the directory xxx
.pre-push
also has the permission to run npm run coverage
.Upvotes: 9
Reputation: 318
for your short description,I can't locate the reason. But you can tryhusky
or ghooks
.
husky
or ghooks
provide git hooks,such as precommit
,prepush
:
//husky
{
"scripts": {
"precommit": "npm test",
"prepush": "npm run coverage",
"...": "..."
}
}
Upvotes: -1