Skip to content

Instantly share code, notes, and snippets.

@mithereal
Last active August 29, 2015 13:59
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 mithereal/10943966 to your computer and use it in GitHub Desktop.
Save mithereal/10943966 to your computer and use it in GitHub Desktop.
chicago boss version commit hook
#!/bin/bash
### get version
VER=$(cat src/*.app.src | grep -Po 'appver."[0-9]*\.[0-9]*\.[0-9]"' | grep -Po '[0-9]*\.[0-9]*\.[0-9]')
VER_ARRAY=(`echo $VER | tr "." "\n"`)
echo "Type of Release: Maj(j), Min(m), Patch(p) (blank skips release tag)"
read type
if ["$type" == "j"]
then
basever="$VER_ARRAY[0]"
incver=$basever + 1
#implode array
version= #implode array
fi
if ["$type" == "m"]
then
basever="$VER_ARRAY[1]"
incver=$basever + 1
version= #implode array
fi
if ["$type" == "p"]
then
basever="$VER_ARRAY[2]"
incver=$basever + 1
version= #implode array
fi
regex='s/appver."[0-9]*\.[0-9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment