@@ -13,8 +13,8 @@ module Hakyll.Commands
15--------------------------------------------------------------------------------
15--------------------------------------------------------------------------------
16−import System.Exit (exitWith)
16+import System.Exit (exitWith, ExitCode)
17−
17+import Control.Applicative
19--------------------------------------------------------------------------------
19--------------------------------------------------------------------------------
20import qualified Hakyll.Check as Check
20import qualified Hakyll.Check as Check
@@ -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,8 @@ 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
39−build conf verbosity rules = do
38+build conf verbosity rules = fst <$> run conf verbosity rules
40− _ <- run conf verbosity rules
44--------------------------------------------------------------------------------
40--------------------------------------------------------------------------------
45-- | Run the checker and exit
41-- | Run the checker and exit
@@ -78,11 +74,9 @@ preview _ _ _ _ = previewServerDisabled
79--------------------------------------------------------------------------------
75--------------------------------------------------------------------------------
80-- | Rebuild the site
76-- | Rebuild the site
81−rebuild :: Configuration -> Verbosity -> Rules a -> IO ()
77+rebuild :: Configuration -> Verbosity -> Rules a -> IO ExitCode
82−rebuild conf verbosity rules = do
78+rebuild conf verbosity rules =
84− build conf verbosity rules
79+ clean conf >> build conf verbosity rules
87--------------------------------------------------------------------------------
81--------------------------------------------------------------------------------
88-- | Start a server
82-- | Start a server