mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 04:24:35 +03:00
ec8b2c80b5
* remove phase one/two distinction and hdbquery typeclass * move extensions to default-extensions * switch to LazyTx which only acquires a connection if needed * move defns from TH module into Ops module * remove tojson orphan instance for http exception * remove orphan instance for dmlp1 * getTopLevelNodes will not throw any exceptions
31 lines
740 B
Haskell
31 lines
740 B
Haskell
module Hasura.Server.Version
|
|
( currentVersion
|
|
, consoleVersion
|
|
)
|
|
where
|
|
|
|
import Control.Lens ((^.))
|
|
|
|
import qualified Data.SemVer as V
|
|
import qualified Data.Text as T
|
|
|
|
import Hasura.Prelude
|
|
import Hasura.Server.Utils (runScript)
|
|
|
|
version :: T.Text
|
|
version = T.dropWhileEnd (== '\n') $(runScript "../scripts/get-version.sh")
|
|
|
|
consoleVersion :: T.Text
|
|
consoleVersion = case V.fromText $ T.dropWhile (== 'v') version of
|
|
Right ver -> mkVersion ver
|
|
Left _ -> version
|
|
|
|
mkVersion :: V.Version -> T.Text
|
|
mkVersion ver = T.pack $ "v" ++ show major ++ "." ++ show minor
|
|
where
|
|
major = ver ^. V.major
|
|
minor = ver ^. V.minor
|
|
|
|
currentVersion :: T.Text
|
|
currentVersion = version
|