feat(server): add /api/version endpoint exposing git hash

This commit is contained in:
Riz Ashraf committed 2026-09-12 09:00:38 +01:00
1 parent 248799ca5d
commit 44df610998
2 files changed
+17

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
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");
}