Some checks failed
Push Workflows / rustfmt (push) Successful in 5s
Push Workflows / tailwind-build (push) Successful in 5s
Push Workflows / test (push) Successful in 22s
Push Workflows / clippy (push) Successful in 17s
Push Workflows / docs (push) Successful in 23s
Push Workflows / build (push) Successful in 51s
Push Workflows / nix-build (push) Failing after 4m1s
20 lines
517 B
Rust
20 lines
517 B
Rust
use std::env;
|
|
use std::process::Command;
|
|
|
|
fn main() {
|
|
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}");
|
|
}
|
|
}
|