Files
pacdef_rust/crates/pacdef/build.rs
T
innocentzero 3d01741401 build: Update build script
cargo version 1.77 onwards added support for cargo:: to communicate with
cargo and deprecated the old cargo: syntax.

Signed-off-by: innocentzero <isfarulhaque@proton.me>
2024-04-30 10:11:04 +05:30

14 lines
335 B
Rust

use std::process::Command;
fn main() {
let git_hash = match Command::new("git")
.args(["rev-parse", "--short", "HEAD"])
.output()
{
Ok(output) => String::from_utf8(output.stdout).expect("git output is utf-8"),
_ => String::new(),
};
println!("cargo::rustc-env=GIT_HASH={git_hash}");
}