Guest User

Untitled

a guest
May 31st, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # regex to validate in commit msg
  4. commit_regex='(#[0-9]+|merge)'
  5. error_msg="Aborting commit. Your commit message is missing either a Issue ('#123') or 'Merge'"
  6.  
  7. if ! grep -iqE "$commit_regex" "$1"; then
  8. echo "$error_msg" >&2
  9. exit 1
  10. fi
  11.  
  12. chmod +x commit-msg
Add Comment
Please, Sign In to add comment