Skip to content

Instantly share code, notes, and snippets.

@philipbeadle
Created December 7, 2016 23:24
Show Gist options
  • Save philipbeadle/0e3f200005587cde4938a8f53e63fefc to your computer and use it in GitHub Desktop.
Save philipbeadle/0e3f200005587cde4938a8f53e63fefc to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
var path = require('path')
, scripts = require('../../')
, name = path.basename(__filename)
, project = scripts();
project.run(name, process.argv.slice(2), function(err) {
if (err) {
console.error('Failed to exec ' + name + ' hook script')
process.exit(err.code);
}
});
then in package.json
"git": {
"scripts": {
"pre-commit": "grunt test"
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment