on master help sign in
Return proper exit status code

Closes #94 Conflicts: src/Hakyll/Core/Run.hs

commit07a721fd777e384cf71d6eb07cd8c33bdf24e139 authorJasper Van der Jeugt <m@jaspervdj.be> dateThu 15 Nov 2012, 10:24 (14 years ago) parent551d4f9
1 file changed+10−6
src/Hakyll/Core/Runtime.hs+10−6
src/Hakyll/Core/Runtime.hs+10−6
@@ -17,6 +17,7 @@ import qualified Data.Map as M
1717import Data.Monoid (mempty)
1818import Data.Set (Set)
1919import qualified Data.Set as S
20+import System.Exit (ExitCode (..), exitWith)
2021import System.FilePath ((</>))
2122
2223
@@ -76,12 +77,15 @@ run configuration rules = do
7677 -- Run the program and fetch the resulting state
7778 result <- runErrorT $ runRWST build read' state
7879 case result of
79− Left e -> Logger.error logger e
80− Right (_, s, _) -> Store.set store factsKey $ runtimeFacts s
81−
82− -- Flush and return
83− Logger.flush logger
84− return ruleSet
80+ Left e -> do
81+ Logger.error logger e
82+ Logger.flush logger
83+ exitWith $ ExitFailure 1
84+
85+ Right (_, s, _) -> do
86+ Store.set store factsKey $ runtimeFacts s
87+ Logger.flush logger
88+ return ruleSet
8589 where
8690 factsKey = ["Hakyll.Core.Runtime.run", "facts"]
8791