Created
May 13, 2014 19:01
-
-
Save naftulikay/ec2acedeb1172c225150 to your computer and use it in GitHub Desktop.
Generate JIRA Ticket Labels
This file contains hidden or 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 | |
function generate-jira-label() { | |
# Generates a 256 square label, given a JIRA name matching the following pattern: | |
# (\w+)-(\d+) | |
# ie: AA-1234, JV-511 | |
if [ -z "$1" ]; then | |
echo "Please provide a JIRA number like AA-1234 as the first argument." >&2 | |
exit 1 | |
fi | |
JIRA="$1" | |
JIRA_CODE="$(echo "$JIRA" | awk -F '-' '{print $1;}')" | |
JIRA_NUMBER="$(echo "$JIRA" | awk -F '-' '{print $2;}')" | |
convert -background white -fill black -font Droid-Sans-Bold -gravity center -size 256x256 \ | |
label:"$JIRA_CODE\\n$JIRA_NUMBER" "$JIRA-label.png" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment