on master help sign in
Deploy should propagate error code

And return 1 if neither deployCommand and deploySite is set.

commit0a818d0725af6d5242d1545bf40a1eb532dfd1e5 authorSimonas Kazlauskas <git@kazlauskas.me> dateWed 22 May 2013, 15:24 (13 years ago) parent2ef7fee
3 files changed+6−5
src/Hakyll/Commands.hs+1−1 src/Hakyll/Core/Configuration.hs+4−3 src/Hakyll/Main.hs+1−1
src/Hakyll/Commands.hs+1−1
@@ -94,7 +94,7 @@ server _ _ = previewServerDisabled
9494
9595--------------------------------------------------------------------------------
9696-- | Upload the site
97−deploy :: Configuration -> IO ()
97+deploy :: Configuration -> IO ExitCode
9898deploy conf = deploySite conf conf
9999
100100
src/Hakyll/Core/Configuration.hs+4−3
@@ -12,6 +12,7 @@ import Control.Monad (void)
1212import Data.Default (Default (..))
1313import Data.List (isPrefixOf, isSuffixOf)
1414import System.Directory (canonicalizePath)
15+import System.Exit (ExitCode)
1516import System.FilePath (isAbsolute, normalise, takeFileName)
1617import System.IO.Error (catchIOError)
1718import System.Process (system)
@@ -65,7 +66,7 @@ data Configuration = Configuration
6566 -- The 'Configuration' object is passed as a parameter to this
6667 -- function.
6768 --
68− deploySite :: Configuration -> IO ()
69+ deploySite :: Configuration -> IO ExitCode
6970 , -- | Use an in-memory cache for items. This is faster but uses more
7071 -- memory.
7172 inMemoryCache :: Bool
@@ -84,8 +85,8 @@ defaultConfiguration = Configuration
8485 , tmpDirectory = "_cache/tmp"
8586 , providerDirectory = "."
8687 , ignoreFile = ignoreFile'
87− , deployCommand = "echo 'No deploy command specified'"
88− , deploySite = void . system . deployCommand
88+ , deployCommand = "echo 'No deploy command specified' && exit 1"
89+ , deploySite = system . deployCommand
8990 , inMemoryCache = True
9091 }
9192 where
src/Hakyll/Main.hs+1−1
@@ -44,7 +44,7 @@ hakyllWith conf rules = do
4444 Build _ -> Commands.build conf verbosity' rules >>= exitWith
4545 Check _ _ -> Commands.check conf verbosity' check'
4646 Clean _ -> Commands.clean conf
47− Deploy _ -> Commands.deploy conf
47+ Deploy _ -> Commands.deploy conf >>= exitWith
4848 Help _ -> showHelp
4949 Preview _ p -> Commands.preview conf verbosity' rules p
5050 Rebuild _ -> Commands.rebuild conf verbosity' rules >>= exitWith