Add option to overwrite git hash on build

This commit is contained in:
bytedream 2024-05-03 20:33:19 +02:00
parent 442173c08c
commit 55f1e1d32d

View file

@ -1,7 +1,8 @@
fn main() -> std::io::Result<()> { fn main() -> std::io::Result<()> {
println!( println!(
"cargo:rustc-env=GIT_HASH={}", "cargo:rustc-env=GIT_HASH={}",
get_short_commit_hash()?.unwrap_or_default() std::env::var("CRUNCHY_CLI_GIT_HASH")
.or::<std::io::Error>(Ok(get_short_commit_hash()?.unwrap_or_default()))?
); );
println!( println!(
"cargo:rustc-env=BUILD_DATE={}", "cargo:rustc-env=BUILD_DATE={}",