@@ -14,6 +14,7 @@ import Control.Monad.Trans (liftIO)
1414import Data.Map (Map)
1515import Data.Monoid (mempty, mappend)
1616import Prelude hiding (reverse)
17+import System.Exit (ExitCode (..), exitWith)
1718import System.FilePath ((</>))
1819import qualified Data.Map as M
1920import qualified Data.Set as S
@@ -74,16 +75,16 @@ run configuration rules = do
7475 }
7576
7677 case result of
77− Left e ->
78+ Left e -> do
7879 thrown logger e
79− Right ((), state') ->
80+ flushLogger logger
81+ exitWith $ ExitFailure 1
82+ Right ((), state') -> do
8083 -- We want to save the final dependency graph for the next run
8184 Store.set store ["Hakyll.Core.Run.run", "dependencies"] $
8285 analyzerGraph $ hakyllAnalyzer state'
83−
84− -- Flush and return
85− flushLogger logger
86− return ruleSet
86+ flushLogger logger
87+ return ruleSet
8788
8889data RuntimeEnvironment = RuntimeEnvironment
8990 { hakyllLogger :: Logger