Skip to content

Instantly share code, notes, and snippets.

@xcsrz
Last active December 16, 2018 05:36
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 xcsrz/55b3651cfa0fc2c0deff2f26896e5879 to your computer and use it in GitHub Desktop.
Save xcsrz/55b3651cfa0fc2c0deff2f26896e5879 to your computer and use it in GitHub Desktop.
Bash function to bump minor semantic version number by even numbers.
releaseBumpValue() {
semver="${1}"
local tifs=${IFS}
local IFS='.'
read -ra bits <<< "${semver}"
if [ $((bits[1]%2)) -eq 0 ]; then
echo 2
else
echo 1
fi
IFS=${tifs}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment