@@ -13,7 +13,7 @@ module Hakyll.Commands
1313
1414
1515--------------------------------------------------------------------------------
16−import System.Exit (exitWith)
16+import System.Exit (exitWith, ExitCode)
1717
1818
1919--------------------------------------------------------------------------------
@@ -25,7 +25,6 @@ import Hakyll.Core.Rules.Internal
2525import Hakyll.Core.Runtime
2626import Hakyll.Core.Util.File
2727
28−
2928--------------------------------------------------------------------------------
3029#ifdef PREVIEW_SERVER
3130import Hakyll.Preview.Poll
@@ -35,11 +34,10 @@ import Hakyll.Preview.Server
3534
3635--------------------------------------------------------------------------------
3736-- | Build the site
38−build :: Configuration -> Verbosity -> Rules a -> IO ()
37+build :: Configuration -> Verbosity -> Rules a -> IO (ExitCode)
3938build conf verbosity rules = do
40− _ <- run conf verbosity rules
41− return ()
42−
39+ (ec, _) <- run conf verbosity rules
40+ return ec
4341
4442--------------------------------------------------------------------------------
4543-- | Run the checker and exit
@@ -78,11 +76,9 @@ preview _ _ _ _ = previewServerDisabled
7876
7977--------------------------------------------------------------------------------
8078-- | Rebuild the site
81−rebuild :: Configuration -> Verbosity -> Rules a -> IO ()
82−rebuild conf verbosity rules = do
83− clean conf
84− build conf verbosity rules
85−
79+rebuild :: Configuration -> Verbosity -> Rules a -> IO (ExitCode)
80+rebuild conf verbosity rules =
81+ clean conf >> build conf verbosity rules
8682
8783--------------------------------------------------------------------------------
8884-- | Start a server