feat(cli): add jj-lib version to version output
Some checks failed
Publish Docker Images / coverage-and-sonar (push) Failing after 6m2s

This commit is contained in:
2026-04-21 21:02:11 +02:00
parent c65e493571
commit 0ec750eb66
4 changed files with 304 additions and 1 deletions

8
build.rs Normal file
View File

@@ -0,0 +1,8 @@
use cargo_lock::Lockfile;
fn main() {
let lockfile = Lockfile::load("Cargo.lock").expect("Cargo.lock not found");
let version = lockfile.packages.iter().find(|p| p.name.as_str() == "jj-lib").map(|p| p.version.to_string()).unwrap_or_else(|| "unknown".to_string());
println!("cargo:rustc-env=JJ_LIB_VERSION={version}");
println!("cargo:rerun-if-changed=Cargo.lock");
}