versionmonkey
v1.0.7
Published
Contains a few useful methods for monkeying around with semantic-version numbers in shell scripts.
Downloads
9
Readme
Contains a few useful methods for monkeying around with semantic-version numbers in shell scripts.
HIGHEST_TAG=$(versionmonkey get-highest-git-tag-version)
# > 5.2.3 (or whatever is the highest nnn.nnn.nnn version in git tags)
# stripped of any prefix or postfix
BRANCH_VERSION=$(versionmonkey get-git-branch-version)
# > 3.4.5 (assuming the branch is release/3.4.5-RC)
CURRENT_VERSION=$(versionmonkey get-package-json-version)
# > 3.4.5 version from local package.json - stripped of prefix and postfix
NEXT_MINOR=$(versionmonkey increment-minor-version "$CURRENT_VERSION")
# Strips any prefix and postfix in the given version,
# then increments the second number and sets the third number to zero.
versionmonkey set-package-json-version "$NEXT_MINOR"
# sets the version field in the local package.json to the given string
# and preserves all formatting in the file