aboutsummaryrefslogtreecommitdiff
path: root/src/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/build.rs')
-rw-r--r--src/build.rs9
1 files changed, 8 insertions, 1 deletions
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(())
}