1
0
mirror of https://github.com/jht5945/finding.git synced 2025-12-27 13:20:03 +08:00
Files
finding/build.rs
2019-08-02 01:18:36 +08:00

8 lines
285 B
Rust

use std::process::Command;
fn main() {
// note: add error checking yourself.
let 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);
}