use std::process::Command;
fn main() {
let mut git_hash = Command::new("git")
.args(&["rev-parse", "HEAD"])
.output()
.ok()
.and_then(|output| String::from_utf8(output.stdout).ok())
.unwrap_or_default();
if git_hash.is_empty() {
git_hash = "cratesio".to_owned();
}
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
}