feat(cli): add jj-lib version to version output
This commit is contained in:
13
build.rs
Normal file
13
build.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
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