summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs3
-rw-r--r--src/Version.hs16
-rw-r--r--src/Version/Git.hs3
3 files changed, 21 insertions, 1 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 54e121b..795cabe 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -43,6 +43,7 @@ import Text.Blaze.Html.Renderer.String
import JavaScript qualified as JS
import Storage.Cache
import Storage.IndexedDB
+import Version
import WebSocket (startClient, receiveMessage)
main :: IO ()
@@ -208,7 +209,7 @@ setup = do
H.button ! A.type_ "submit" $ "set name"
H.div ! A.id "version" $ do
- "v0.1.0"
+ H.toHtml versionLine
when (js_string_is_null experimentalAccepted) $ do
H.div ! A.id "experimental_warning" $ do
diff --git a/src/Version.hs b/src/Version.hs
new file mode 100644
index 0000000..cca3c6d
--- /dev/null
+++ b/src/Version.hs
@@ -0,0 +1,16 @@
+module Version (
+ versionLine,
+) where
+
+import Paths_erebos_webapp (version)
+import Data.Version (showVersion)
+import Version.Git
+
+{-# NOINLINE versionLine #-}
+versionLine :: String
+versionLine = do
+ let ver = case gitVersion of
+ Just gver
+ -> "git " <> gver
+ _ -> "v" <> showVersion version
+ in ver
diff --git a/src/Version/Git.hs b/src/Version/Git.hs
new file mode 100644
index 0000000..ecf8715
--- /dev/null
+++ b/src/Version/Git.hs
@@ -0,0 +1,3 @@
+module Version.Git where
+gitVersion :: Maybe String
+gitVersion = Nothing