This project is a command-line tool designed to facilitate version management of your codebase using Semantic Versioning. It updates version numbers in specified files and commits changes to Git, streamlining the release process.
- Automatically updates Git status.
- Increments version numbers (major, minor, patch).
- Updates specified template files with new version and build date.
- Commits changes to Git automatically.
To install the tool globally, use npm:
npm install -g git-version-updaterOnce installed, you can use the tool directly from the command line:
git-version-updater [command] [options]Updates the Git status file with modified files.
git-version-updater statusUpdates version numbers and commits changes to Git.
Options:
-M, --major: Increment major version.-m, --minor: Increment minor version.-p, --patch: Increment patch version (default).-t, --template <file>: Specify a template file to update.
Example:
git-version-updater commit --minor --template path/to/template.txtUpdates Git status, version numbers, and commits changes in one command.
Options are the same as for the commit command.
Example:
git-version-updater update-commit --majorThe current version is stored in version.json. If this file doesn't exist, it defaults to 0.1.0.
The tool uses a .zzz-git-status file to track modified files in the Git repository.
If specified, a template file will be updated with the new version and build date. Any occurrences of {version} and {date} in the file will be replaced.