Created
July 13, 2020 12:00
-
-
Save joostlawerman/f54015eee9f1abf4b7fff0e65059d550 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 | |
FILE=$1 | |
MESSAGE=$(cat $FILE) | |
TICKET=$(git rev-parse --abbrev-ref HEAD | grep -Eo '^(\w+/)?(\w+[-_])?[0-9]+' | grep -Eo '(\w+[-])?[0-9]+' | tr "[:lower:]" "[:upper:]") | |
if [[ $TICKET == "[]" || "$MESSAGE" == "$TICKET"* ]];then | |
exit 0; | |
fi | |
echo "$TICKET: $MESSAGE" > $FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment