bump_version icon indicating copy to clipboard operation
bump_version copied to clipboard

Bash script to increment version numbers in multiple files

Bash script to increment version numbers in multiple files.

The script assumes the existence of a package.json file so should be used for JavaScript packages.

Initially a Gist I had created but has been converted to a full repo so it can be cloned and used as a submodule for different projects.

Installation

Copy bump_files.sh.dist to bump_files.sh and edit files to bump in the newly created file.

Usage

Increment a semver version part by one:

$ ./bump_version.sh <major|minor|patch>

Fine grained control:

$ ./bump_version.sh <version-from> <version-to>

Hooks

Add scripts to the hooks/prebump and hooks/postbump directories to have them executed before and after the version bump, respectively. Hook scripts must have a .hook extension.

License

Released under the MIT license