aboutsummaryrefslogtreecommitdiffstats
path: root/src/consts.rs
diff options
context:
space:
mode:
authorJonas Maier <>2026-05-23 21:38:05 +0200
committerJonas Maier <>2026-05-23 21:38:05 +0200
commitcb63ecee3d07fca77513c6d74e64aed79ad263db (patch)
tree6c9fb0b08f8744eea17b5ed36db3a8a390b754db /src/consts.rs
parent8316ec37e248abbd25342750c1a84b059896df90 (diff)
downloadpish-cb63ecee3d07fca77513c6d74e64aed79ad263db.tar.gz
can now build without git command or .git directory
Diffstat (limited to 'src/consts.rs')
-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();