Created
August 9, 2016 11:41
-
-
Save adamcheasley/e278c1ff9cf4fdfadf2dafe36ce0170a to your computer and use it in GitHub Desktop.
simple script to get the current version of your code
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 | |
DESCRIBE=`git describe --tags` | |
MAJOR=`echo $DESCRIBE | awk '{split($0,a,"."); print a[1]}'` | |
MINOR=`echo $DESCRIBE | awk '{split($0,a,"."); print a[2]}'` | |
BUG=`echo $DESCRIBE | awk '{split($0,a,"."); print a[3]}'` | |
echo $MAJOR | |
echo $MINOR | |
echo $BUG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment