From 1ae1cc294560d8c99aaf8f49baa016104cda8ff7 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sun, 3 Jan 2021 11:42:09 -0500 Subject: Signed-off-by: Christine Dodrill --- src/build.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/build.rs b/src/build.rs index 0d8d5a5..600de8a 100644 --- a/src/build.rs +++ b/src/build.rs @@ -9,6 +9,13 @@ fn main() -> Result<()> { .output() .unwrap(); let git_hash = String::from_utf8(output.stdout).unwrap(); - println!("cargo:rustc-env=GITHUB_SHA={}", git_hash); + println!( + "cargo:rustc-env=GITHUB_SHA={}", + if git_hash.as_str() == "" { + env!("out").into() + } else { + git_hash + } + ); Ok(()) } -- cgit v1.2.3