MCPcopy Create free account
hub / github.com/bootc-dev/bootc / get_package_version

Function get_package_version

crates/xtask/src/man.rs:511–525  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

509/// Get version from Cargo.toml
510#[context("Querying package version")]
511fn get_package_version() -> Result<String> {
512 let cargo_toml =
513 fs::read_to_string("crates/lib/Cargo.toml").context("Reading crates/lib/Cargo.toml")?;
514
515 let parsed: toml::Table = cargo_toml.parse().context("Parsing Cargo.toml")?;
516
517 let version = parsed
518 .get("package")
519 .and_then(|p| p.as_table())
520 .and_then(|p| p.get("version"))
521 .and_then(|v| v.as_str())
522 .ok_or_else(|| anyhow::anyhow!("Could not find package.version in Cargo.toml"))?;
523
524 Ok(format!("v{}", version))
525}
526
527/// Single command to update all man pages - auto-discover new commands and sync existing ones
528pub fn update_manpages(sh: &Shell) -> Result<()> {

Callers 1

generate_man_pagesFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected