Skip to content

Instantly share code, notes, and snippets.

@leggsimon
Last active November 22, 2017 22:33
Show Gist options
  • Save leggsimon/fba47077f705afc4493d7a62add3c15f to your computer and use it in GitHub Desktop.
Save leggsimon/fba47077f705afc4493d7a62add3c15f to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
console.log('\x1b[1m','Please wait for linting to run...','\x1b[0m');
console.log('You can','\x1b[1m','skip','\x1b[0m','the precommit hook by running "git commit -n" instead','\x1b[1m', "but beware!",'\x1b[0m');
require('child_process').exec(
'make verify',
function (error, stdout) {
console.log(stdout && 'stdout: ' + stdout);
if (error !== null) {
console.log('\x1b[31m', error, '\x1b[0m')
process.abort(0);
}
}
);
#!/usr/bin/env node
console.log('\x1b[1m','Please wait for tests to run...','\x1b[0m');
console.log('You can','\x1b[1m','skip','\x1b[0m','the precommit hook by running "git commit -n" instead','\x1b[1m', "but beware!",'\x1b[0m');
require('child_process').exec(
'make test',
function (error, stdout) {
console.log(stdout && 'stdout: ' + stdout);
if (error !== null) {
console.log('\x1b[31m', error, '\x1b[0m')
process.abort(0);
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment