Fix nix build (#1171)
I forgot nix builds in a sandbox, so my laziness earlier meant that the nix build fails - sandbox has no git!
This commit is contained in:
parent
b48de9bd9d
commit
f3e9f27456
1 changed files with 7 additions and 6 deletions
|
@ -1,10 +1,11 @@
|
|||
use std::process::Command;
|
||||
fn main() {
|
||||
let output = Command::new("git")
|
||||
.args(["rev-parse", "HEAD"])
|
||||
.output()
|
||||
.unwrap();
|
||||
let output = Command::new("git").args(["rev-parse", "HEAD"]).output();
|
||||
|
||||
let git_hash = String::from_utf8(output.stdout).unwrap();
|
||||
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
||||
let sha = match output {
|
||||
Ok(sha) => String::from_utf8(sha.stdout).unwrap(),
|
||||
Err(_) => String::from("NO_GIT"),
|
||||
};
|
||||
|
||||
println!("cargo:rustc-env=GIT_HASH={}", sha);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue