feat(server): add /api/version endpoint exposing git hash
This commit is contained in:
1 parent
248799ca5d
commit
44df610998
2 files changed
+17
No files matched your search
@@ -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");
|
||||
}
|
||||
Reference in new issue
Block a user