git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
initial pscpp --version support
commit83ea7ec389e98a87c367db6433957f71486b0495 authorAndy Arvanitis <andyarvanitis@gmail.com> dateWed 24 Jul 2019, 21:03 (7 years ago) parent096b51a
3 files changed+10−1
app/Main.hs+8 package.yaml+1 src/Tests.hs+1−1
app/Main.hs+8
@@ -29,6 +29,8 @@ import qualified Data.Text.Lazy as L
2929import qualified Data.Text.Lazy.Encoding as L
3030import qualified Data.ByteString as B
3131
32+import Development.GitRev
33+
3234import Language.PureScript.AST.Literals
3335import Language.PureScript.CoreFn
3436import Language.PureScript.CoreFn.FromJSON
@@ -65,6 +67,11 @@ main = do
6567 B.writeFile "Makefile" $(embedFile "support/Makefile")
6668 when ("--help" `elem` opts') $
6769 putStrLn help
70+ when ("--version" `elem` opts') $ do
71+ let branch = $(gitBranch)
72+ details | branch == "master" = "master, commit: " ++ $(gitHash)
73+ | otherwise = branch
74+ putStrLn $ details ++ if $(gitDirty) then " (DIRTY)" else ""
6875 when (not $ null files) $ do
6976 let filepath = takeDirectory (head files)
7077 baseOutpath = joinPath $ (init $ splitDirectories filepath) ++ [outdir]
@@ -154,6 +161,7 @@ help = "Usage: pscpp OPTIONS COREFN-FILES\n\
154161 \ PureScript-to-C++ compiler\n\n\
155162 \Available options:\n\
156163 \ --help Show this help text\n\n\
164+ \ --version Show the version number\n\n\
157165 \ --makefile Generate a GNU Makefile which can be used for compiling\n\
158166 \ a PureScript program and libraries to a native binary via\n\
159167 \ purs corefn output and C++\n\n\
package.yaml+1
@@ -39,6 +39,7 @@ dependencies:
3939- directory -any
4040- process -any
4141- file-embed -any
42+- gitrev -any
4243
4344library:
4445 source-dirs: src
src/Tests.hs+1−1
@@ -31,7 +31,7 @@ runTests = do
3131 let srcDir = outputDir </> "src"
3232 createDirectory srcDir
3333
34− callProcess "git" ["clone", "--branch", "v0.13.0", "--depth", "1", "https://github.com/purescript/purescript.git"]
34+ callProcess "git" ["clone", "--branch", "v0.13.2", "--depth", "1", "https://github.com/purescript/purescript.git"]
3535 let passingDir = baseDir </> "purescript" </> "tests" </> "purs" </> "passing"
3636 passingTestCases <- sort . filter (".purs" `isSuffixOf`) <$> getDirectoryContents passingDir
3737