atuin/atuin/build.rs
Ellie Huxtable f3e9f27456
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!
2023-08-14 09:58:57 +01:00

11 lines
305 B
Rust

use std::process::Command;
fn main() {
let output = Command::new("git").args(["rev-parse", "HEAD"]).output();
let sha = match output {
Ok(sha) => String::from_utf8(sha.stdout).unwrap(),
Err(_) => String::from("NO_GIT"),
};
println!("cargo:rustc-env=GIT_HASH={}", sha);
}