summaryrefslogtreecommitdiff
path: root/src/Hakyll/Main.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-06-15 08:53:47 +0200
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-06-15 08:53:47 +0200
commitfbe95ce6ce53fee904c62d986897ad3b340429d7 (patch)
treea4d7e5639e78576549c324af85d2c13559eb3114 /src/Hakyll/Main.hs
parent7c75227b9a1e99bd01c605408d7c0cf5e175c978 (diff)
downloadhakyll-fbe95ce6ce53fee904c62d986897ad3b340429d7.tar.gz
Add deploy command
Diffstat (limited to 'src/Hakyll/Main.hs')
-rw-r--r--src/Hakyll/Main.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Hakyll/Main.hs b/src/Hakyll/Main.hs
index 2513303..ef5c4c8 100644
--- a/src/Hakyll/Main.hs
+++ b/src/Hakyll/Main.hs
@@ -8,8 +8,9 @@ module Hakyll.Main
import Control.Applicative ((<$>))
import Control.Concurrent (forkIO)
import Control.Monad (when)
-import System.Environment (getProgName, getArgs)
import System.Directory (doesDirectoryExist, removeDirectoryRecursive)
+import System.Environment (getProgName, getArgs)
+import System.Process (system)
import qualified Data.Set as S
import Hakyll.Core.Configuration
@@ -40,6 +41,7 @@ hakyllWith conf rules = do
["rebuild"] -> rebuild conf rules
["server"] -> server conf 8000
["server", p] -> server conf (read p)
+ ["deploy"] -> deploy conf
_ -> help
-- | Build the site
@@ -80,6 +82,7 @@ help = do
, name ++ " preview [port] Run a server and autocompile"
, name ++ " rebuild Clean up and build again"
, name ++ " server [port] Run a local test server"
+ , name ++ " deploy Upload/deploy your site"
]
-- | Preview the site
@@ -109,3 +112,10 @@ server conf port = do
staticServer destination preServeHook port
where
preServeHook _ = return ()
+
+-- Upload the site
+--
+deploy :: HakyllConfiguration -> IO ()
+deploy conf = do
+ _ <- system $ deployCommand conf
+ return ()