https://github.com/conventional-commits-rs/cargo-next
A cargo subcommand to query or set the version of a crate.
https://github.com/conventional-commits-rs/cargo-next
cargo-subcommand cli rust-library
Last synced: about 1 year ago
JSON representation
A cargo subcommand to query or set the version of a crate.
- Host: GitHub
- URL: https://github.com/conventional-commits-rs/cargo-next
- Owner: conventional-commits-rs
- License: apache-2.0
- Created: 2020-08-05T22:33:52.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-03-08T01:28:48.000Z (over 2 years ago)
- Last Synced: 2025-05-06T02:20:10.123Z (about 1 year ago)
- Topics: cargo-subcommand, cli, rust-library
- Language: Nix
- Homepage: https://crates.io/crates/cargo-next
- Size: 94.7 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: license-apache
Awesome Lists containing this project
README
# cargo-next
[](https://github.com/conventional-commits-rs/cargo-next)
[](https://crates.io/crates/cargo-next)
[](https://crates.io/crates/cargo-next)
[](https://docs.rs/cargo-next)
> A cargo subcommand to set the next version of a crate.
## Installation
```text
cargo install cargo-next --locked
```
## Usage
### Binary
```text
$ cargo next --minor
$ cargo next 0.1.5
$ ./emits-new-version.sh | cargo next
$ cargo next --get
0.2.3
```
### Library
```rust
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.