summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Version.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Version.hs b/src/Version.hs
index 6679ae1..c0f7edf 100644
--- a/src/Version.hs
+++ b/src/Version.hs
@@ -6,10 +6,12 @@ module Version ( version ) where
import Control.Monad.Trans (liftIO)
import qualified Language.Haskell.TH as TH
import System.Process (readProcess)
+import GHC.IO (catchAny)
version :: String
version = "walint rc3 2021 (" <>
$(do
- hash <- liftIO $ readProcess "git" ["rev-parse", "HEAD"] ""
+ hash <- liftIO $ catchAny (readProcess "git" ["rev-parse", "HEAD"] "")
+ (\_ -> pure "[unknown]")
pure . TH.LitE . TH.StringL $ take 40 hash) ++
")"