diff --git a/src/Version.hs b/src/Version.hs index 6679ae12089a0bd3be40c74a2010b88475bba712..c0f7edf9b9c08979786d952223e381eac33aaca5 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) ++ ")"