summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorstuebinm2021-11-10 23:26:10 +0100
committerstuebinm2021-11-10 23:28:12 +0100
commit0b29a7e82a8c2dcf9ce4f2fba3ec07896fa72397 (patch)
treee508d14d432595eaf13cea2a7dead9cd7ef28953 /src
parent1338e4a1c9f445e5384cdee3d65cf5a46ce03105 (diff)
fail on missing map assets
(but not (yet?) on missing maps/entrypoints)
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 1862c5b..9fefd82 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -17,6 +17,7 @@ import CheckDir (recursiveCheckDir)
import WriteRepo (writeAdjustedRepository)
import Types (Level (..))
import Util (printPretty)
+import System.Exit (exitWith)
-- | the options this cli tool can take
data Options = Options
@@ -47,15 +48,16 @@ run options = do
lints <- recursiveCheckDir repo entry
- case out options of
- Just outpath -> writeAdjustedRepository repo outpath lints
- Nothing -> pure ()
-
if json options
then printLB
$ if pretty options then encodePretty lints else encode lints
else printPretty (level, lints)
+ case out options of
+ Just outpath -> writeAdjustedRepository repo outpath lints
+ >>= exitWith
+ Nothing -> pure ()
+
-- | haskell's many string types are FUN …
printLB :: LB.ByteString -> IO ()
printLB a = putStrLn $ C8.unpack $ LB.toStrict a