Created
February 24, 2013 16:25
-
-
Save wesen/5024421 to your computer and use it in GitHub Desktop.
make a release name
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 | |
| hextodec() { | |
| until [ -z "$1" ] | |
| do | |
| i=`echo "$1" | tr '[:lower:]' '[:upper:]'` | |
| echo "obase=10;ibase=16;$i" | bc | |
| shift | |
| done | |
| } | |
| lowerwords () { | |
| cat /usr/share/dict/words | grep -e '^.\{1,8\}$' | tr [:upper:] [:lower:] | |
| } | |
| LOWERWORDS=`` | |
| GITREV=$(hextodec $(git rev-parse --short=8 HEAD)) | |
| FIRST=$(echo $GITREV | cut -c 1-4) | |
| LAST=$(echo $GITREV | cut -c 5-8) | |
| FIRSTNAME=$(lowerwords | tail -n $FIRST | head -n1) | |
| LASTNAME=$(lowerwords | tail -n $LAST | head -n1) | |
| echo $FIRSTNAME-$LASTNAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment