summaryrefslogtreecommitdiff
path: root/src/Version.hs
blob: d09ed36b80a3682f6bb255b5c4e6aa1fbc28bacc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{-# LANGUAGE TemplateHaskell #-}

-- "Pattern match is redundant" warning can be generated based on template
-- haskell $$tGitVersion value
{-# OPTIONS_GHC -Wno-error=overlapping-patterns #-}

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