on master help sign in
Deploy should propagate error code
0a818d0Simonas Kazlauskas
src/Hakyll/Commands.hs+1−1
@@ -94,7 +94,7 @@ server _ _ = previewServerDisabled
94
94
95--------------------------------------------------------------------------------
95--------------------------------------------------------------------------------
96-- | Upload the site
96-- | Upload the site
97−deploy :: Configuration -> IO ()
97+deploy :: Configuration -> IO ExitCode
98deploy conf = deploySite conf conf
98deploy conf = deploySite conf conf
99
99
100
100
src/Hakyll/Core/Configuration.hs+4−3
@@ -12,6 +12,7 @@ import Control.Monad (void)
12import Data.Default (Default (..))
12import Data.Default (Default (..))
13import Data.List (isPrefixOf, isSuffixOf)
13import Data.List (isPrefixOf, isSuffixOf)
14import System.Directory (canonicalizePath)
14import System.Directory (canonicalizePath)
15+import System.Exit (ExitCode)
15import System.FilePath (isAbsolute, normalise, takeFileName)
16import System.FilePath (isAbsolute, normalise, takeFileName)
16import System.IO.Error (catchIOError)
17import System.IO.Error (catchIOError)
17import System.Process (system)
18import System.Process (system)
@@ -65,7 +66,7 @@ data Configuration = Configuration
65 -- The 'Configuration' object is passed as a parameter to this
66 -- The 'Configuration' object is passed as a parameter to this
66 -- function.
67 -- function.
67 --
68 --
68− deploySite :: Configuration -> IO ()
69+ deploySite :: Configuration -> IO ExitCode
69 , -- | Use an in-memory cache for items. This is faster but uses more
70 , -- | Use an in-memory cache for items. This is faster but uses more
70 -- memory.
71 -- memory.
71 inMemoryCache :: Bool
72 inMemoryCache :: Bool
@@ -84,8 +85,8 @@ defaultConfiguration = Configuration
84 , tmpDirectory = "_cache/tmp"
85 , tmpDirectory = "_cache/tmp"
85 , providerDirectory = "."
86 , providerDirectory = "."
86 , ignoreFile = ignoreFile'
87 , ignoreFile = ignoreFile'
87− , deployCommand = "echo 'No deploy command specified'"
88+ , deployCommand = "echo 'No deploy command specified' && exit 1"
88− , deploySite = void . system . deployCommand
89+ , deploySite = system . deployCommand
89 , inMemoryCache = True
90 , inMemoryCache = True
90 }
91 }
91 where
92 where
src/Hakyll/Main.hs+1−1
@@ -44,7 +44,7 @@ hakyllWith conf rules = do
44 Build _ -> Commands.build conf verbosity' rules >>= exitWith
44 Build _ -> Commands.build conf verbosity' rules >>= exitWith
45 Check _ _ -> Commands.check conf verbosity' check'
45 Check _ _ -> Commands.check conf verbosity' check'
46 Clean _ -> Commands.clean conf
46 Clean _ -> Commands.clean conf
47− Deploy _ -> Commands.deploy conf
47+ Deploy _ -> Commands.deploy conf >>= exitWith
48 Help _ -> showHelp
48 Help _ -> showHelp
49 Preview _ p -> Commands.preview conf verbosity' rules p
49 Preview _ p -> Commands.preview conf verbosity' rules p
50 Rebuild _ -> Commands.rebuild conf verbosity' rules >>= exitWith
50 Rebuild _ -> Commands.rebuild conf verbosity' rules >>= exitWith