Skip to content

Instantly share code, notes, and snippets.

@atdt
Created May 24, 2012 20:09
Show Gist options
  • Select an option

  • Save atdt/2783918 to your computer and use it in GitHub Desktop.

Select an option

Save atdt/2783918 to your computer and use it in GitHub Desktop.
simple pre-commit hook to run npm test
#!/usr/bin/env node
(function () {
var npm = require('npm');
function done( error ) {
process.exit( error === null ? 1 : 0 );
}
function test() {
this.commands.test( done );
}
return npm.load( test );
}());
/* vim: set ft=javascript: */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment