2023-11-08 04:21:59 +00: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 18:06:51 +00:00
|
|
|
println!("cargo:rustc-env=GIT_COMMIT_SHA={rev}");
|
|
|
|
println!("cargo:rustc-rerun-if-changed=.git/HEAD");
|
2023-01-28 04:15:52 +00:00
|
|
|
}
|