build: Remove implicit git build requirement

This commit is contained in:
Victoria Brekenfeld 2022-02-11 17:33:48 +01:00
parent 1b498acfb9
commit a0e0f5a1d3

View file

@ -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);
}
}