From a0e0f5a1d3ca3175fdb13d6eb4b606a4f3f067ba Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Fri, 11 Feb 2022 17:33:48 +0100 Subject: [PATCH] build: Remove implicit git build requirement --- build.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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); + } }