bach version keeps the version of your app in one place. It lists what every version file says, or raises the version in all of them at once. The release workflow runs it, and you can run it by hand.
Behaviour
- The new version is the only thing written to standard output. The changed files go to standard error, so a script can capture the version.
- The base is the version in
bach.toml; without abach.toml, the first file found. Files that disagree are all set to the new version. - An exact version can’t be lower than the current one.
patchon a pre-release such as1.5.0-rc.1gives1.5.0. - Without a target, it exits with code
1if the files disagree, and names the two that do. - Only the version text is replaced, so line endings, key order and formatting stay as they were.
Machine-readable output
With--json, standard output is one JSON object and nothing else. Listing gives ok, version (the one everything says) and files (the files that carry it). Raising gives ok, version (the new one), dry_run and changed (the files changed, or that would be with --dry-run).
Files that are kept in step
These are used when they exist next tobach.toml: