use std::env;
use std::process::Command;
fn main() {
if env::var("GIT_HASH").is_err() {
let output = Command::new("git").args(["rev-parse", "HEAD"]).output()
.expect("Failed to execute 'git rev-parse HEAD' command");
let git_hash = String::from_utf8_lossy(&output.stdout).trim().to_string();
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
}
}