最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - git hooks pre-push is not working - Stack Overflow

programmeradmin2浏览0评论

Inside git hook folder, I have pre push file inside it i am running "npm run coverage" i.e. mand for unit test coverage.

git-hook > pre-push > npm run coverage

but it is not working, can somebody please help me.

Inside git hook folder, I have pre push file inside it i am running "npm run coverage" i.e. mand for unit test coverage.

git-hook > pre-push > npm run coverage

but it is not working, can somebody please help me.

Share Improve this question asked Sep 18, 2017 at 5:39 RVCoderRVCoder 5424 silver badges15 bronze badges 1
  • Have you checked the permissions of the pre-push file? The execution bit must be set... – Fabien Bouleau Commented Sep 18, 2017 at 6:34
Add a ment  | 

3 Answers 3

Reset to default 9
  1. Check if its name is precisely pre-push (not pre-push.sh, not pre-push.py, precisely pre-push, with no file extension).
  2. Check if it's in .git/hooks/. If you have set core.hooksPath=xxx in the config, make sure it's under the directory xxx.
  3. Check if it's executable.
  4. Check if the user that runs pre-push also has the permission to run npm run coverage.

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

for your short description,I can't locate the reason. But you can tryhusky or ghooks.

husky or ghooks provide git hooks,such as premit,prepush:

//husky
{
  "scripts": {
    "premit": "npm test",
    "prepush": "npm run coverage",
    "...": "..."
  }
}
发布评论

评论列表(0)

  1. 暂无评论