build: Remove implicit git build requirement
This commit is contained in:
parent
1b498acfb9
commit
a0e0f5a1d3
1 changed files with 6 additions and 4 deletions
10
build.rs
10
build.rs
|
|
@ -3,10 +3,12 @@
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let output = Command::new("git")
|
if let Some(output) = Command::new("git")
|
||||||
.args(&["rev-parse", "HEAD"])
|
.args(&["rev-parse", "HEAD"])
|
||||||
.output()
|
.output()
|
||||||
.unwrap();
|
.ok()
|
||||||
let git_hash = String::from_utf8(output.stdout).unwrap();
|
{
|
||||||
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
let git_hash = String::from_utf8(output.stdout).unwrap();
|
||||||
|
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue