use std::process::Command; pub fn main() { let cmdout = Command::new("git") .arg("rev-parse").arg("HEAD") .output().expect("git rev-parse HEAD failed"); println!("cargo:rustc-env=GIT_VERSION={}", String::from_utf8(cmdout.stdout).expect("git revision not UTF-8")); }