diff --git a/build.rs b/build.rs index be94c38c..cc1fe41f 100644 --- a/build.rs +++ b/build.rs @@ -3,10 +3,12 @@ use std::process::Command; fn main() { - let output = Command::new("git") + if let Some(output) = Command::new("git") .args(&["rev-parse", "HEAD"]) .output() - .unwrap(); - let git_hash = String::from_utf8(output.stdout).unwrap(); - println!("cargo:rustc-env=GIT_HASH={}", git_hash); + .ok() + { + let git_hash = String::from_utf8(output.stdout).unwrap(); + println!("cargo:rustc-env=GIT_HASH={}", git_hash); + } }