git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
initial psgo --version support
7143d57Andy Arvanitis
app/Main.hs+11−2
@@ -31,6 +31,8 @@ import qualified Data.Text.Lazy as L
31import qualified Data.Text.Lazy.Encoding as L
31import qualified Data.Text.Lazy.Encoding as L
32import qualified Data.ByteString as B
32import qualified Data.ByteString as B
33
33
34+import Development.GitRev
35+
34import Language.PureScript.AST.Literals
36import Language.PureScript.AST.Literals
35import Language.PureScript.CoreFn
37import Language.PureScript.CoreFn
36import Language.PureScript.CoreFn.FromJSON
38import Language.PureScript.CoreFn.FromJSON
@@ -62,8 +64,15 @@ main = do
62 if "--tests" `elem` opts'
64 if "--tests" `elem` opts'
63 then runTests
65 then runTests
64 else do
66 else do
65− if "--help" `elem` opts'
67+ if "--help" `elem` opts' || "--version" `elem` opts'
68+ then do
69+ when ("--help" `elem` opts') $ do
66− then putStrLn help
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 ""
67 else do
76 else do
68 if null files
77 if null files
69 then do
78 then do
package.yaml+1
@@ -41,6 +41,7 @@ dependencies:
41- process -any
41- process -any
42- file-embed -any
42- file-embed -any
43- filemanip -any
43- filemanip -any
44+- gitrev -any
44
45
45library:
46library:
46 source-dirs: src
47 source-dirs: src