Skip to content

Instantly share code, notes, and snippets.

@itmustbejj
Last active January 25, 2017 18:45
Show Gist options
  • Save itmustbejj/e401380d806081e7ef9bf175c023aa21 to your computer and use it in GitHub Desktop.
Save itmustbejj/e401380d806081e7ef9bf175c023aa21 to your computer and use it in GitHub Desktop.
function bump_cookbook {
#export BUMP_TYPE=${1:-p}
declare -A bump_types
#bump_types=(["patch"]="p" ["minor"]="mi" ["major"]="ma")
bump_types["patch"]="p"
export SV=`grep -o '\([0-9]*\.[0-9]*\.[0-9]*\)' metadata.rb`;
sed -i -e "s/$SV/`eval increment_version -$1 $SV`/g" metadata.rb }
unset SV
alias bcma="bump_cookbook mmajor;git add metadata.rb"
alias bcmi="bump_cookbook minor;git add metadata.rb"
alias bcp="bump_cookbook patch;git add metadata.rb"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment