Skip to content

mt bump

Michael Schwartz edited this page Jul 22, 2021 · 8 revisions

The bump command can be used to bump the semver-style version of a package or program. You can bump the major, minor, patch, or prerelease components of the version string.

Bumping a package version is a several step process, beyond the simple version string modification:

  1. The version string is updated in the pubspec.yaml file
  2. A version entry is made in the CHANGELOG.md file. If you do not provide a message on the command line, you will be prompted for one using your $EDITOR.
  3. Optionally git commit your work, using the supplied message as the commit message.
    3a) Optionally push your work to the (GitHub/GitLab/etc.) git repository.
  4. Optionally fix all the pubspec.yaml files in the monorepo subdirectories that refer to the updated package.

Consider 1.2.3-rc1 as a version string to be operated on.

bump -t prerelease

This would update the example version string to 1.2.3-rc2

bump -t patch

This would update the example version string to 1.2.4-rc1

bump -t minor

This would update the example version string to 1.3.0-rc1

Note that the patch is set to 0 when bumping the minor component of the version string.

bump -t major

This would update the example version string to 2.0.0-rc1

Note that the patch and minor components of the version string are set to 0 when bumping the major component of the version string.

# mt help bump

 ========================
 == mt by Modus Create ==
 ========================

bump version numbers

Usage: mt bump [arguments]
-h, --help           Print this usage information.
-t, --type           [major, minor, patch (default), prerelease]
-m, --message        Message to add to CHANGELOG and for git commit
-f, --[no-]fix       Update monorepo packages that refer to this (mt.yaml type package only)
-c, --[no-]commit    Perform git commit using message
-p, --[no-]push      Perform git commit using message, then do git push

Run "mt help" to see global options.

Clone this wiki locally