pubver

CLI tool to set/bump the version key in pubspec.yaml. Semver-compliant*.

Installing

You can install the package from the command line:

pub global activate pubspec_version

This will add the pubver binary to your ~/.pub-cache/bin.

Usage

Bumping the version

pubver bump <part>

where <part> can be either breaking, major, minor or patch.

Examples

BeforeCommandAfter
1.2.3pubver bump breaking2.0.0
0.2.1pubver bump breaking0.3.0
0.2.1pubver bump major1.0.0
0.2.1pubver bump minor0.3.0
0.2.1pubver bump patch0.2.1

Setting the version

pubver set <version>

where <version> can be any arbitrary version.

Output

The tool prints the new version to stdout. This allows post processing, e.g. making a git commit.

git ci . -m "Release $(pubver bump breaking)"

*almost. It uses pub_semver which is a bit different.

Libraries

pubspec_version