diff options
-rw-r--r-- | Biz/Bild.hs | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/Biz/Bild.hs b/Biz/Bild.hs index 4d55e0b..eee3c49 100644 --- a/Biz/Bild.hs +++ b/Biz/Bild.hs @@ -115,7 +115,6 @@ import qualified Data.Conduit as Conduit import qualified Data.Conduit.List as Conduit import qualified Data.Conduit.Process as Conduit import qualified Data.List as List -import qualified Data.Map as Map import qualified Data.Maybe as Maybe import qualified Data.Set as Set import qualified Data.String as String @@ -152,28 +151,21 @@ move args = >> pure (Cli.getAllArgs args (Cli.argument "target")) /> filter (not <. Namespace.isCab) +> filterM Dir.doesFileExist - +> traverse (\fn -> analyze fn /> (fn,)) - /> filter (snd .> isJust) - /> Map.fromList - /> Map.map Maybe.fromJust - /> Map.filter (namespace .> isBuildableNs) + +> traverse analyze + /> filter isJust + /> map Maybe.fromJust + /> filter (namespace .> isBuildableNs) +> printOrBuild +> exitSummary where - printOrBuild :: Map FilePath Target -> IO [ExitCode] - printOrBuild analyses + printOrBuild :: [Target] -> IO [ExitCode] + printOrBuild targets | args `Cli.has` Cli.longOption "json" = - analyses - |> Map.elems - |> putJSON - >> pure [Exit.ExitSuccess] + traverse_ putJSON targets >> pure [Exit.ExitSuccess] | otherwise = do root <- Env.getEnv "BIZ_ROOT" createHier root - analyses - |> Map.toList - |> map snd - |> traverse (build isTest isLoud) + traverse (build isTest isLoud) targets isTest = args `Cli.has` Cli.longOption "test" isLoud = args `Cli.has` Cli.longOption "loud" putJSON = Aeson.encode .> ByteString.toStrict .> Char8.putStrLn |