fn main() {
if let Ok(out) = std::process::Command::new("git")
.args(["rev-parse", "--short", "HEAD"])
.output()
{
let hash = String::from_utf8_lossy(&out.stdout).trim().to_string();
if !hash.is_empty() {
println!("cargo:rustc-env=BUILD_COMMIT={hash}");
}
}
println!("cargo:rerun-if-changed=.git/HEAD");
}