Skip to content

Commit

Permalink
only exit if there is a failure, makes it easier to use as a library
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Sydney Kerckhove committed Jun 15, 2021
1 parent 41a2962 commit f182ec4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions seocheck/src/SeoCheck.hs
Expand Up @@ -60,10 +60,9 @@ runSeoCheck Settings {..} = do
resultsMap <- readTVarIO results
bytestringMaker <- byteStringMakerFromEnvironment
mapM_ (mapM_ SB.putStr . chunksToByteStrings bytestringMaker) $ renderSEOResult $ SEOResult {seoResultPageResults = resultsMap}
exitWith $
if any resultBad resultsMap
then ExitFailure 1
else ExitSuccess
when (any resultBad resultsMap)
$ exitWith
$ ExitFailure 1

newtype SEOResult
= SEOResult
Expand Down

0 comments on commit f182ec4

Please sign in to comment.