{-# LANGUAGE TemplateHaskell #-} 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 $ catchAny (readProcess "git" ["rev-parse", "HEAD"] "") (\_ -> pure "[unknown]") pure . TH.LitE . TH.StringL $ take 40 hash) ++ ")"