summaryrefslogtreecommitdiff
path: root/src/Hakyll/Main.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-02-15 18:43:22 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-02-15 18:43:22 +0100
commit3346123ca661d578ccb458e7135f8b68867bf107 (patch)
treea95af7f70050ecbc106791cee4ed89edff89c462 /src/Hakyll/Main.hs
parent5a591ee24c50ed25702c06f8f811189984e443ea (diff)
downloadhakyll-3346123ca661d578ccb458e7135f8b68867bf107.tar.gz
Receive list of used resources in Run module
Diffstat (limited to 'src/Hakyll/Main.hs')
-rw-r--r--src/Hakyll/Main.hs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Hakyll/Main.hs b/src/Hakyll/Main.hs
index 64800c2..74097f7 100644
--- a/src/Hakyll/Main.hs
+++ b/src/Hakyll/Main.hs
@@ -6,13 +6,15 @@ module Hakyll.Main
) where
import Control.Concurrent (forkIO)
-import Control.Monad (when)
+import Control.Monad (when, forM_)
import System.Environment (getProgName, getArgs)
import System.Directory (doesDirectoryExist, removeDirectoryRecursive)
+import qualified Data.Set as S
import Hakyll.Core.Configuration
import Hakyll.Core.Run
import Hakyll.Core.Rules
+import Hakyll.Core.Rules.Internal
import Hakyll.Web.Preview.INotify
import Hakyll.Web.Preview.Server
@@ -41,7 +43,9 @@ hakyllWith configuration rules = do
-- | Build the site
--
build :: HakyllConfiguration -> Rules -> IO ()
-build = run
+build configuration rules = do
+ _ <- run configuration rules
+ return ()
-- | Remove the output directories
--
@@ -80,11 +84,19 @@ help = do
--
preview :: HakyllConfiguration -> Rules -> Int -> IO ()
preview configuration rules port = do
+ -- Build once, keep the rule set
+ ruleSet <- run configuration rules
+
+ -- Debug: show the resources used
+ forM_ (S.toList $ rulesResources ruleSet) $ putStrLn . show
+
+ {-
-- Fork a thread polling for changes
_ <- forkIO $ previewPoll configuration "." $ build configuration rules
-- Run the server in the main thread
server configuration port
+ -}
-- | Rebuild the site
--