Crates.io | cargo-next |
lib.rs | cargo-next |
version | 0.2.3 |
source | src |
created_at | 2020-08-05 22:36:50.927109 |
updated_at | 2023-07-21 02:16:13.771419 |
description | A cargo subcommand to set the next crate version |
homepage | |
repository | https://github.com/conventional-commits-rs/cargo-next |
max_upload_size | |
id | 273437 |
size | 77,753 |
A cargo subcommand to set the next version of a crate.
cargo install cargo-next --locked
$ cargo next --minor
$ cargo next 0.1.5
$ ./emits-new-version.sh | cargo next
$ cargo next --get
0.2.3
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);