#cargo-version

bin+lib cargo-next

A cargo subcommand to set the next crate version

9 releases

0.2.3 Jul 21, 2023
0.2.2 Mar 22, 2021
0.1.4 Aug 15, 2020
0.0.0 Aug 5, 2020

#353 in Cargo plugins

MIT/Apache

18KB
124 lines

cargo-next

Maintenance crates.io crates.io Documentation

A cargo subcommand to set the next version of a crate.

Installation

cargo install cargo-next --locked

Usage

Binary

$ cargo next --minor
$ cargo next 0.1.5
$ ./emits-new-version.sh | cargo next
$ cargo next --get
0.2.3

Library

use cargo_next::{bump_version, get_version, set_version, SemVer};

let path_to_toml = ...;

// Bump the version by a semver component.
let _res = bump_version(&path_to_toml, SemVer::Minor);
// Set the version directly.
let _res = set_version(&path_to_toml, "0.1.2");
// Or get the version of a crate.
let _res = get_version(&path_to_toml);

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~4MB
~73K SLoC