Created
March 5, 2014 14:38
-
-
Save saml/9368402 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#~/.git_template/hooks/commit-msg | |
[[ "" != "$(grep -e '[A-Z]\+-[0-9]\+' "$1")" ]] || { | |
cat "$1" | |
echo >&2 "ERROR: No Jira ticket." | |
exec < /dev/tty | |
read -r -p "Proceed? [Yn]> " answer | |
if [[ "$answer" = "n" ]] | |
then | |
echo >&2 "Commit message saved to $1." | |
exit 1 | |
else | |
echo "Proceeding without Jira ticket..." | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment