Skip to content

Instantly share code, notes, and snippets.

@wickdninja
Created December 22, 2017 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wickdninja/ada0407f470bb6d442f94623642f1d05 to your computer and use it in GitHub Desktop.
Save wickdninja/ada0407f470bb6d442f94623642f1d05 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
var message = process.argv[2];
var hasTicketRef = (message !== undefined && message !== null && message.length > 0 && message.substring(0,4) === 'ABP-');
var exitCode = (hasTicketRef)? 0 : 1;
if(!hasTicketRef){
console.log('Jira ABP ticket reference required! \n Example:\n git commit -m "ABP-0000 #resolve #time 3h 20m"');
}
process.exit(exitCode);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment