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

module Version (
    versionLine,
) where

import Paths_erebos (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 CLI " <> ver