feat(cli): add jj-lib version to version output
Some checks failed
Publish Docker Images / coverage-and-sonar (push) Failing after 6m2s
Some checks failed
Publish Docker Images / coverage-and-sonar (push) Failing after 6m2s
This commit is contained in:
8
build.rs
Normal file
8
build.rs
Normal 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");
|
||||
}
|
||||
Reference in New Issue
Block a user