summaryrefslogtreecommitdiff
path: root/src/Version.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2023-03-01 21:51:24 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2023-03-01 21:51:24 +0100
commitdf1cc5d142e8d0e332341b82eb581e77c328f687 (patch)
tree218aad7a946574b794a4658c36dbef59019e1c29 /src/Version.hs
parent8f4bb4eddb4dabf20a9256d406a1b9823a54879b (diff)
Version information from git
Diffstat (limited to 'src/Version.hs')
-rw-r--r--src/Version.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Version.hs b/src/Version.hs
new file mode 100644
index 0000000..ace016b
--- /dev/null
+++ b/src/Version.hs
@@ -0,0 +1,19 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+module Version (
+ versionLine,
+) where
+
+import Paths_erebos_tester (version)
+import Data.Version (showVersion)
+import Version.Git
+
+{-# NOINLINE versionLine #-}
+versionLine :: String
+versionLine = do
+ let ver = case $$tGitVersion of
+ Just gver
+ | 'v':v <- gver, not $ all (`elem` ('.': ['0'..'9'])) v
+ -> "git " <> gver
+ _ -> "version " <> showVersion version
+ in "Erebos Tester " <> ver