Command line tool for bumping project versions.
Add a version.json file to the root of your project.
Use the command line utility in build scripts to increment the version number.
It supports the semver terminology of major, minor and patch.
Show current version:
bump
Typing bump by itself in a directory containing a version.json file will show the current version on the command line.
e.g.
0.1.4
If the version contains a build number > 0 then it will show the build also.
e.g.
0.1.4 (15)
Performing an increment action reads the file, increments the requested element and writes the file back out. This is ideal for automated release scripts.
build:
bump --build
patch:
bump --patch
minor:
bump --minor
major:
bump --major
This will load the version file, increment the patch number and write it back out.
bump --new
Creates a new version.json file is the current folder.
Make the file executable:
chmod +x bump
To install the command globally:
sudo cp bump /usr/local/bin
A useful technique for creating a release using gitflow is to use the following command from the develop branch:
bump | xargs git flow release start
Assuming your current version is 1.2.3, this command is the equivalent of typing:
git flow release start 1.2.3
This command can easily be added as an alias to facilitate process automation.