{-|
Module: IHP.Version
Description: Find out the current IHP version
Copyright: (c) digitally induced GmbH, 2020
-}
module IHP.Version where

import IHP.Prelude
import qualified Paths_ihp
import Data.Version (showVersion)

data Edition = Basic | Pro | Business | Enterprise
    deriving (Edition -> Edition -> Bool
(Edition -> Edition -> Bool)
-> (Edition -> Edition -> Bool) -> Eq Edition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Edition -> Edition -> Bool
== :: Edition -> Edition -> Bool
$c/= :: Edition -> Edition -> Bool
/= :: Edition -> Edition -> Bool
Eq, Int -> Edition -> ShowS
[Edition] -> ShowS
Edition -> String
(Int -> Edition -> ShowS)
-> (Edition -> String) -> ([Edition] -> ShowS) -> Show Edition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Edition -> ShowS
showsPrec :: Int -> Edition -> ShowS
$cshow :: Edition -> String
show :: Edition -> String
$cshowList :: [Edition] -> ShowS
showList :: [Edition] -> ShowS
Show)

-- | Returns the git commit hash of https://github.com/digitallyinduced/ihp at which this IHP version was built
ihpVersion :: Text
ihpVersion :: Text
ihpVersion = String -> Text
forall a b. ConvertibleStrings a b => a -> b
cs (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$! Version -> String
showVersion Version
Paths_ihp.version

ihpEdition :: Edition
ihpEdition :: Edition
ihpEdition = Edition
Basic