From 62d066d49688f47e3d7af18926467eb44e7a6349 Mon Sep 17 00:00:00 2001
From: Lennart Spitzner <hexagoxel@hexagoxel.de>
Date: Thu, 5 Apr 2018 21:05:19 +0200
Subject: [PATCH] Un-ignore coreIO error-numbers when processing one file only

---
 src-brittany/Main.hs | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src-brittany/Main.hs b/src-brittany/Main.hs
index 7538411..a48540b 100644
--- a/src-brittany/Main.hs
+++ b/src-brittany/Main.hs
@@ -183,9 +183,10 @@ mainCmdParser helpDesc = do
       trace (showConfigYaml config) $ return ()
 
     results <- zipWithM (coreIO putStrErrLn config suppressOutput) inputPaths outputPaths
-    case sequence_ results of
-      Left  _ -> System.Exit.exitWith (System.Exit.ExitFailure 1)
-      Right _ -> pure ()
+    case results of
+      xs | all Data.Either.isRight xs -> pure ()
+      [Left x] -> System.Exit.exitWith (System.Exit.ExitFailure x)
+      _        -> System.Exit.exitWith (System.Exit.ExitFailure 1)
 
 
 -- | The main IO parts for the default mode of operation, and after commandline