add git commit hash when hovering version info

This commit is contained in:
2025-11-05 00:33:17 +00:00
parent e5e335f4f3
commit 4c00d1846b
2 changed files with 14 additions and 1 deletions
+12
View File
@@ -8,4 +8,16 @@ fn main() {
.set_icon("assets/icon.ico")
.compile()
.unwrap();
println!(
"cargo:rustc-env=LATEST_GIT_COMMIT_HASH={}",
latest_git_commit_hash()
)
}
fn latest_git_commit_hash() -> String {
let git_rev_parse = std::process::Command::new("git")
.args(&["rev-parse", "--short=8", "HEAD"])
.output()
.unwrap();
String::from_utf8(git_rev_parse.stdout).unwrap()
}