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;
|
use std::process::Command;
|
||||||
fn main() {
|
fn main() {
|
||||||
let output = Command::new("git")
|
let output = Command::new("git").args(["rev-parse", "HEAD"]).output();
|
||||||
.args(["rev-parse", "HEAD"])
|
|
||||||
.output()
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let git_hash = String::from_utf8(output.stdout).unwrap();
|
let sha = match output {
|
||||||
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
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