summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Main.hs b/src/Main.hs
index d115660..572dc76 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -13,10 +13,10 @@ import Data.Aeson.KeyMap (coercionToHashMap)
import qualified Data.ByteString.Char8 as C8
import qualified Data.ByteString.Lazy as LB
import Data.Maybe (fromMaybe)
-import System.Exit (exitWith)
+import System.Exit (exitWith, ExitCode (..))
import WithCli
-import CheckDir (recursiveCheckDir)
+import CheckDir (recursiveCheckDir, resultIsFatal)
import LintConfig (LintConfig (..), patch)
import Types (Level (..))
import Util (printPretty)
@@ -74,7 +74,9 @@ run options = do
case out options of
Just outpath -> writeAdjustedRepository lintconfig repo outpath lints
>>= exitWith
- Nothing -> pure ()
+ Nothing -> exitWith $ case resultIsFatal lintconfig lints of
+ False -> ExitSuccess
+ True -> ExitFailure 1
-- | haskell's many string types are FUN …
printLB :: LB.ByteString -> IO ()