12 lines
387 B
Rust
12 lines
387 B
Rust
use std::process::Command;
|
|
|
|
fn main() {
|
|
if let Ok(output) = Command::new("git").args(&["rev-parse", "--short", "HEAD"]).output() {
|
|
if let Ok(hash) = String::from_utf8(output.stdout) {
|
|
println!("cargo:rustc-env=GIT_HASH={}", hash.trim());
|
|
}
|
|
}
|
|
println!("cargo:rerun-if-changed=../.git/HEAD");
|
|
println!("cargo:rerun-if-changed=../.git/index");
|
|
}
|