cargo-version-sync
Cargo subcommand for keeping the version numbers in sync with Cargo.toml
Exeperimental
shell-session
$ cargo install cargo-version-sync
Cargo.toml
for specifying files to rewrite the version numbers by cargo version-sync
:toml
[[package.metadata.version-sync.replacements]]
file = "README.md"
patterns = [
{ search = "https://deps.rs/crate/tsukuyomi/[a-z0-9\\.-]+", replace = "https://deps.rs/crate/tsukuyomi/{{version}}" },
]
cargo-version-sync
to rewrite version numbers:shell-session
$ cargo version-sync [--verbose] [--dry-run]
toml
[dev-dependencies.cargo-husky]
version = "1"
default-features = false
features = ["user-hooks"]
in .cargo-husky/hooks/pre-commit
:
```sh
set -e
if cargo fmt --version >/dev/null 2>&1; then (set -x; cargo fmt -- --check) fi
if cargo version-sync --version >/dev/null 2>&1; then (set -x; cargo version-sync --check) fi ```
cargo test
in tests/version_sync.rs
:
```rust extern crate cargoversionsync;
fn testversionsync() { cargoversionsync::assert_sync(); } ```