@@ -1,6 +1,6 @@
11-- | This is the module which binds it all together
22--
3−{-# LANGUAGE GeneralizedNewtypeDeriving #-}
3+{-# LANGUAGE GeneralizedNewtypeDeriving, OverloadedStrings #-}
44module Hakyll.Core.Run
55 ( run
66 ) where
@@ -10,7 +10,7 @@ import Control.Monad (filterM)
1010import Control.Monad.Trans (liftIO)
1111import Control.Applicative (Applicative, (<$>))
1212import Control.Monad.Reader (ReaderT, runReaderT, ask)
13−import Control.Monad.State.Strict (StateT, evalStateT, get, modify)
13+import Control.Monad.State.Strict (StateT, runStateT, get, modify)
1414import Control.Arrow ((&&&))
1515import qualified Data.Map as M
1616import Data.Monoid (mempty, mappend)
@@ -50,9 +50,13 @@ run configuration rules = do
5050
5151 -- Extract the reader/state
5252 reader = unRuntime $ addNewCompilers [] compilers
53− state' = runReaderT reader $ env logger ruleSet provider store
53+ stateT = runReaderT reader $ env logger ruleSet provider store
5454
55− evalStateT state' state
55+ -- Run the program and fetch the resulting state
56+ ((), state') <- runStateT stateT state
57+
58+ -- We want to save the final dependency graph for the next run
59+ storeSet store "Hakyll.Core.Run.run" "dependencies" $ hakyllGraph state'
5660
5761 -- Flush and return
5862 flushLogger logger