diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-21 20:38:13 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-21 20:38:13 +0100 |
commit | c32e57262b1c4544c323ea04c21608aef1126765 (patch) | |
tree | aa9a2375586a30014d617bf5836faceda699f03e /src/Hakyll | |
parent | 6b4c65642e21684bc143eaf29453d1d99fd9e227 (diff) | |
download | hakyll-c32e57262b1c4544c323ea04c21608aef1126765.tar.gz |
Add a runtime test
Diffstat (limited to 'src/Hakyll')
-rw-r--r-- | src/Hakyll/Core/Configuration.hs | 4 | ||||
-rw-r--r-- | src/Hakyll/Core/Runtime.hs | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/Hakyll/Core/Configuration.hs b/src/Hakyll/Core/Configuration.hs index 650fe97..df73e01 100644 --- a/src/Hakyll/Core/Configuration.hs +++ b/src/Hakyll/Core/Configuration.hs @@ -18,6 +18,9 @@ data Configuration = Configuration destinationDirectory :: FilePath , -- | Directory where hakyll's internal store is kept storeDirectory :: FilePath + , -- | Directory where hakyll finds the files to compile. This is @.@ by + -- default. + providerDirectory :: FilePath , -- | Function to determine ignored files -- -- In 'defaultHakyllConfiguration', the following files are ignored: @@ -58,6 +61,7 @@ defaultConfiguration :: Configuration defaultConfiguration = Configuration { destinationDirectory = "_site" , storeDirectory = "_cache" + , providerDirectory = "." , ignoreFile = ignoreFile' , deployCommand = "echo 'No deploy command specified'" , inMemoryCache = True diff --git a/src/Hakyll/Core/Runtime.hs b/src/Hakyll/Core/Runtime.hs index d219252..dba2af9 100644 --- a/src/Hakyll/Core/Runtime.hs +++ b/src/Hakyll/Core/Runtime.hs @@ -42,15 +42,14 @@ import Hakyll.Core.Writable -------------------------------------------------------------------------------- run :: Configuration -> Rules a -> IO RuleSet -run configuration rules = do +run config rules = do -- Initialization logger <- Logger.new Logger.Debug putStrLn Logger.header logger "Initialising..." Logger.message logger "Creating store..." - store <- Store.new (inMemoryCache configuration) $ - storeDirectory configuration + store <- Store.new (inMemoryCache config) $ storeDirectory config Logger.message logger "Creating provider..." - provider <- newProvider store (ignoreFile configuration) "." + provider <- newProvider store (ignoreFile config) $ providerDirectory config Logger.message logger "Running rules..." ruleSet <- runRules rules provider @@ -62,7 +61,7 @@ run configuration rules = do -- Build runtime read/state let compilers = rulesCompilers ruleSet read' = RuntimeRead - { runtimeConfiguration = configuration + { runtimeConfiguration = config , runtimeLogger = logger , runtimeProvider = provider , runtimeStore = store |