@@ -13,7 +13,7 @@ module Hakyll.Commands
15--------------------------------------------------------------------------------
15--------------------------------------------------------------------------------
16−import System.Exit (exitWith)
16+import System.Exit (exitWith, ExitCode)
19--------------------------------------------------------------------------------
19--------------------------------------------------------------------------------
@@ -25,7 +25,6 @@ import Hakyll.Core.Rules.Internal
25import Hakyll.Core.Runtime
25import Hakyll.Core.Runtime
26import Hakyll.Core.Util.File
26import Hakyll.Core.Util.File
29--------------------------------------------------------------------------------
28--------------------------------------------------------------------------------
30#ifdef PREVIEW_SERVER
29#ifdef PREVIEW_SERVER
31import Hakyll.Preview.Poll
30import Hakyll.Preview.Poll
@@ -35,11 +34,10 @@ import Hakyll.Preview.Server
36--------------------------------------------------------------------------------
35--------------------------------------------------------------------------------
37-- | Build the site
36-- | Build the site
38−build :: Configuration -> Verbosity -> Rules a -> IO ()
37+build :: Configuration -> Verbosity -> Rules a -> IO (ExitCode)
39build conf verbosity rules = do
38build conf verbosity rules = do
40− _ <- run conf verbosity rules
39+ (ec, _) <- run conf verbosity rules
41− return ()
40+ return ec
44--------------------------------------------------------------------------------
42--------------------------------------------------------------------------------
45-- | Run the checker and exit
43-- | Run the checker and exit
@@ -78,11 +76,9 @@ preview _ _ _ _ = previewServerDisabled
79--------------------------------------------------------------------------------
77--------------------------------------------------------------------------------
80-- | Rebuild the site
78-- | Rebuild the site
81−rebuild :: Configuration -> Verbosity -> Rules a -> IO ()
79+rebuild :: Configuration -> Verbosity -> Rules a -> IO (ExitCode)
82−rebuild conf verbosity rules = do
80+rebuild conf verbosity rules =
84− build conf verbosity rules
81+ clean conf >> build conf verbosity rules
87--------------------------------------------------------------------------------
83--------------------------------------------------------------------------------
88-- | Start a server
84-- | Start a server