on master help sign in
Return proper exit status code
ac4bba5Jasper Van der Jeugt
src/Hakyll/Core/Run.hs+7−6
@@ -14,6 +14,7 @@ import Control.Monad.Trans (liftIO)
14import Data.Map (Map)
14import Data.Map (Map)
15import Data.Monoid (mempty, mappend)
15import Data.Monoid (mempty, mappend)
16import Prelude hiding (reverse)
16import Prelude hiding (reverse)
17+import System.Exit (ExitCode (..), exitWith)
17import System.FilePath ((</>))
18import System.FilePath ((</>))
18import qualified Data.Map as M
19import qualified Data.Map as M
19import qualified Data.Set as S
20import qualified Data.Set as S
@@ -74,16 +75,16 @@ run configuration rules = do
74 }
75 }
75
76
76 case result of
77 case result of
77− Left e ->
78+ Left e -> do
78 thrown logger e
79 thrown logger e
80+ flushLogger logger
81+ exitWith $ ExitFailure 1
79− Right ((), state') ->
82+ Right ((), state') -> do
80 -- We want to save the final dependency graph for the next run
83 -- We want to save the final dependency graph for the next run
81 Store.set store ["Hakyll.Core.Run.run", "dependencies"] $
84 Store.set store ["Hakyll.Core.Run.run", "dependencies"] $
82 analyzerGraph $ hakyllAnalyzer state'
85 analyzerGraph $ hakyllAnalyzer state'
83−
84− -- Flush and return
85− flushLogger logger
86+ flushLogger logger
86− return ruleSet
87+ return ruleSet
87
88
88data RuntimeEnvironment = RuntimeEnvironment
89data RuntimeEnvironment = RuntimeEnvironment
89 { hakyllLogger :: Logger
90 { hakyllLogger :: Logger