diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2023-04-25 22:17:58 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2023-04-25 22:17:58 +0200 |
commit | 780fc8894379f28af0f03bc27c3a41aca8c95b5a (patch) | |
tree | e5bdc1db78df4a58c27a73b8fea675eb5c9328a4 /src/Version.hs | |
parent | 649ba09db13caea5de5d179c538b8a2945a9a69d (diff) |
Command-line option to report version
Diffstat (limited to 'src/Version.hs')
-rw-r--r-- | src/Version.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Version.hs b/src/Version.hs new file mode 100644 index 0000000..d476912 --- /dev/null +++ b/src/Version.hs @@ -0,0 +1,19 @@ +{-# LANGUAGE TemplateHaskell #-} + +module Version ( + versionLine, +) where + +import Paths_minici (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 "MiniCI " <> ver |