diff options
Diffstat (limited to 'Biz')
-rw-r--r-- | Biz/Bild.hs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Biz/Bild.hs b/Biz/Bild.hs index 9c341b9..ceb4856 100644 --- a/Biz/Bild.hs +++ b/Biz/Bild.hs @@ -131,6 +131,7 @@ import qualified Data.Text as Text import Rainbow (chunk, fore, green, putChunkLn, red) import qualified System.Directory as Dir import qualified System.Environment as Env +import qualified System.Exit as Exit import System.FilePath ((</>)) import qualified System.Process as Process import qualified Text.Regex.Applicative as Regex @@ -153,6 +154,7 @@ help = bild Usage: + bild test bild [--test] <target>... Options: @@ -312,10 +314,15 @@ build andTest target@Target {..} = do "-o", outDir </> out ] - when andTest <| do - putStrLn <| "bild: dev: test: " <> Namespace.toPath namespace - Process.callProcess (outDir </> out) ["test"] putChunkLn <| fore green <| "bilt: " <> nschunk namespace + when andTest <| do + Process.readProcessWithExitCode (outDir </> out) ["test"] "" >>= \case + (Exit.ExitSuccess, _, _) -> + putChunkLn <| fore green <| "test: " <> nschunk namespace + (Exit.ExitFailure _, out, err) -> do + putChunkLn <| fore red <| "test: " <> nschunk namespace + when (out /= mempty) <| putStr out + when (err /= mempty) <| putStr err GhcLib -> do putStrLn <| "bild: dev: ghc-lib: " <> Namespace.toPath namespace putText <| "bild: dev: bilder: " <> Text.pack builder |