Skip to content

Instantly share code, notes, and snippets.

@adamcheasley
Created August 9, 2016 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamcheasley/e278c1ff9cf4fdfadf2dafe36ce0170a to your computer and use it in GitHub Desktop.
Save adamcheasley/e278c1ff9cf4fdfadf2dafe36ce0170a to your computer and use it in GitHub Desktop.
simple script to get the current version of your code
#! /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