0

Our pre-git configuration in package.json looks like

"pre-git": {
      "pre-commit": [
        "npm run lint",
        "npm run coverage",
        "npm run coverage-check"
      ],
      "post-commit": [
        "git status"
      ]
    }

But, the "pre-commit" hook is not waiting for "npm run coverage" to complete (which is an istanbul cover task). npm run coverage runs fine individually. Are we missing something?

Thanks

PlayMa256
  • 6,603
  • 2
  • 34
  • 54
kallada
  • 1,829
  • 4
  • 33
  • 64

1 Answers1

1

Try not using "npm run" ... Just list the tools by them aliases available on scripts section. This is the way I worked with NodeJS. "pre-git" is new to me. I used directly a package called "pre-commit" which worked fine the way I just described.

Then, for a more generic solution, I wrote this tool:

https://pypi.org/project/hooks4git/

Lovato
  • 2,250
  • 1
  • 16
  • 22