git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
initial psgo --version support
commit7143d575263c6495e31aa0c5dabbb7ed7db850c1 authorAndy Arvanitis <andyarvanitis@gmail.com> dateWed 24 Jul 2019, 21:30 (7 years ago) parent9ce9a6d
2 files changed+12−2
app/Main.hs+11−2 package.yaml+1
app/Main.hs+11−2
@@ -31,6 +31,8 @@ import qualified Data.Text.Lazy as L
3131import qualified Data.Text.Lazy.Encoding as L
3232import qualified Data.ByteString as B
3333
34+import Development.GitRev
35+
3436import Language.PureScript.AST.Literals
3537import Language.PureScript.CoreFn
3638import Language.PureScript.CoreFn.FromJSON
@@ -62,8 +64,15 @@ main = do
6264 if "--tests" `elem` opts'
6365 then runTests
6466 else do
65− if "--help" `elem` opts'
66− then putStrLn help
67+ if "--help" `elem` opts' || "--version" `elem` opts'
68+ then do
69+ when ("--help" `elem` opts') $ do
70+ putStrLn help
71+ when ("--version" `elem` opts') $ do
72+ let branch = $(gitBranch)
73+ details | branch == "golang" = "master, commit " ++ $(gitHash)
74+ | otherwise = branch
75+ putStrLn $ details ++ if $(gitDirty) then " (DIRTY)" else ""
6776 else do
6877 if null files
6978 then do
package.yaml+1
@@ -41,6 +41,7 @@ dependencies:
4141- process -any
4242- file-embed -any
4343- filemanip -any
44+- gitrev -any
4445
4546library:
4647 source-dirs: src