kazazor / git-pre-commit

A pre-commit hook that ignores all the unstagged changes while performing the pre-commit command you wrote (Using Shell, Gulp, Grunt etc..)
https://www.npmjs.com/package/git-pre-commit
MIT License
18 stars 5 forks source link

Document development dependency on `yarn` #42

Open mmurphy opened 5 years ago

mmurphy commented 5 years ago

Since this repo includes a yarn.lock file and git hooks, any commits will require the yarn command. Otherwise it will generate an error:

mmurphy-OSX:git-pre-commit mmurphy$ git commit
events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: spawn yarn ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
    at onErrorNT (internal/child_process.js:407:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
    at onErrorNT (internal/child_process.js:407:16)
    [... lines matching original stack trace ...]
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

Should the dependency on yarn be documented in the README or a contributing file? Or give a better error from pre-commit-utils/package-manager-utils.js if yarn is not installed?

WDYT?