observing / pre-commit

Automatically installs a git pre-commit script in your git repository which runs your `npm test` on pre-commit
MIT License
1.88k stars 153 forks source link

miss script but get nothing error message #133

Open nightInSummer opened 6 years ago

nightInSummer commented 6 years ago

package.json like this:

"scripts": {
    "start": "",
    "dev": "rm -rf public && ./node_modules/.bin/webpack --progress --color -w -d",
    "server": "node server.js"
  },
  "pre-commit": [
    "lint"
  ],

It caused my git cannot commit everything but no error information was obtained. Why not print some error message to the console?

fildon commented 4 years ago

It's failing because you don't have a 'lint' script. Each entry in your 'pre-commit' array should match an entry in your scripts object. As is it can't find a 'lint' script so it fails.