Skip to content

Instantly share code, notes, and snippets.

@isaacrankin
Last active September 28, 2015 04:18
Show Gist options
  • Save isaacrankin/c636b5032e5dbd416724 to your computer and use it in GitHub Desktop.
Save isaacrankin/c636b5032e5dbd416724 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
require('shelljs/global');
// Prevent committing of debug configurations
console.log('Performing pre-commit tests...');
if (!which('git')) {
echo('Sorry, this script requires git');
process.exit(1);
};
// gets contents of staged config file, and run it
var config = eval(exec('git show :app/config.js', { silent:true }).output);
if(config.DebugServer){
console.error('---> Debug server should not be enabled in app/config.js');
process.exit(1);
}
console.log('Pre-commit tests passed.');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment