summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2012-11-15 10:24:46 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2012-11-15 10:32:25 +0100
commit07a721fd777e384cf71d6eb07cd8c33bdf24e139 (patch)
tree60c8ae4868e75221572b9a5a9b98fb8373f4c4f9 /src
parent551d4f9f4f425aed8dfe99a4669f1ed795ee83f6 (diff)
downloadhakyll-07a721fd777e384cf71d6eb07cd8c33bdf24e139.tar.gz
Return proper exit status code
Closes #94 Conflicts: src/Hakyll/Core/Run.hs
Diffstat (limited to 'src')
-rw-r--r--src/Hakyll/Core/Runtime.hs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Hakyll/Core/Runtime.hs b/src/Hakyll/Core/Runtime.hs
index 23c24b1..a66e4b5 100644
--- a/src/Hakyll/Core/Runtime.hs
+++ b/src/Hakyll/Core/Runtime.hs
@@ -17,6 +17,7 @@ import qualified Data.Map as M
import Data.Monoid (mempty)
import Data.Set (Set)
import qualified Data.Set as S
+import System.Exit (ExitCode (..), exitWith)
import System.FilePath ((</>))
@@ -76,12 +77,15 @@ run configuration rules = do
-- Run the program and fetch the resulting state
result <- runErrorT $ runRWST build read' state
case result of
- Left e -> Logger.error logger e
- Right (_, s, _) -> Store.set store factsKey $ runtimeFacts s
-
- -- Flush and return
- Logger.flush logger
- return ruleSet
+ Left e -> do
+ Logger.error logger e
+ Logger.flush logger
+ exitWith $ ExitFailure 1
+
+ Right (_, s, _) -> do
+ Store.set store factsKey $ runtimeFacts s
+ Logger.flush logger
+ return ruleSet
where
factsKey = ["Hakyll.Core.Runtime.run", "facts"]