Set GIT_REV from build script
Some checks failed
Push Workflows / rustfmt (push) Failing after 5s
Push Workflows / tailwind-build (push) Successful in 5s
Push Workflows / test (push) Successful in 28s
Push Workflows / clippy (push) Successful in 23s
Push Workflows / docs (push) Successful in 27s
Push Workflows / build (push) Has been cancelled
Push Workflows / nix-build (push) Has been cancelled

This commit is contained in:
2026-06-20 22:34:09 -04:00
parent e5c968933e
commit e0f003d5a8

View File

@@ -1,3 +1,19 @@
use std::process::Command;
use std::env;
fn main() { fn main() {
println!("cargo:rerun-if-changed=migrations"); println!("cargo:rerun-if-changed=migrations");
println!("cargo:rerun-if-changed=.git");
if env::var("GIT_REV").is_err() {
let git_rev: String = Command::new("git")
.args(["rev-parse", "HEAD"])
.output()
.expect("Failed to run git rev-parse")
.stdout
.try_into()
.expect("Failed to parse output from git");
println!("cargo:rustc-env=GIT_REV={git_rev}");
}
} }