summaryrefslogtreecommitdiff
path: root/src/Version.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Version.hs')
-rw-r--r--src/Version.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Version.hs b/src/Version.hs
new file mode 100644
index 0000000..6679ae1
--- /dev/null
+++ b/src/Version.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+
+module Version ( version ) where
+
+import Control.Monad.Trans (liftIO)
+import qualified Language.Haskell.TH as TH
+import System.Process (readProcess)
+
+version :: String
+version = "walint rc3 2021 (" <>
+ $(do
+ hash <- liftIO $ readProcess "git" ["rev-parse", "HEAD"] ""
+ pure . TH.LitE . TH.StringL $ take 40 hash) ++
+ ")"