aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/consts.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/consts.rs b/src/consts.rs
index 7e5d0fd..2e04183 100644
--- a/src/consts.rs
+++ b/src/consts.rs
@@ -1,3 +1,6 @@
pub const PISH_VERSION: &str = env!("CARGO_PKG_VERSION");
-pub const PISH_COMMIT: &str = env!("GIT_HASH_SHORT");
+pub const PISH_COMMIT: &str = match option_env!("GIT_HASH_SHORT") {
+ Some(hash) => hash,
+ None => "unknown",
+};
pub const PISH_DIRTY: bool = option_env!("GIT_DIRTY").is_some();