2023-11-07 20:21:59 -08:00
|
|
|
fn main() {
|
|
|
|
let output = std::process::Command::new("git")
|
|
|
|
.args(["rev-parse", "HEAD"])
|
|
|
|
.output()
|
|
|
|
.expect("Failed to execute git");
|
|
|
|
let rev = String::from_utf8(output.stdout).expect("Failed to parse git output");
|
2022-12-14 10:06:51 -08:00
|
|
|
println!("cargo:rustc-env=GIT_COMMIT_SHA={rev}");
|
|
|
|
println!("cargo:rustc-rerun-if-changed=.git/HEAD");
|
2023-01-27 20:15:52 -08:00
|
|
|
}
|