summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/File.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-14 20:46:08 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-14 20:46:08 +0100
commit4bc34b8a98ffa1e7f3478a596b73c4ab12d9cb1b (patch)
tree86ff0e311ec49f794b28f973c95620918ab4f9ee /src/Text/Hakyll/File.hs
parent332f2f95cdb9c72e01a55eaf46c0b08bcf37d7e9 (diff)
downloadhakyll-4bc34b8a98ffa1e7f3478a596b73c4ab12d9cb1b.tar.gz
Added ReaderT to our stack.
Diffstat (limited to 'src/Text/Hakyll/File.hs')
-rw-r--r--src/Text/Hakyll/File.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Hakyll/File.hs b/src/Text/Hakyll/File.hs
index 0ed91d5..3dd2538 100644
--- a/src/Text/Hakyll/File.hs
+++ b/src/Text/Hakyll/File.hs
@@ -17,6 +17,8 @@ import System.Directory
import System.FilePath
import Control.Monad
import Data.List (isPrefixOf)
+import Text.Hakyll.Hakyll (Hakyll)
+import Control.Monad.Reader (liftIO)
-- | Auxiliary function to remove pathSeparators form the start. We don't deal
-- with absolute paths here. We also remove $root from the start.
@@ -90,8 +92,10 @@ havingExtension :: String -> [FilePath] -> [FilePath]
havingExtension extension = filter ((==) extension . takeExtension)
-- | Perform an IO action on every file in a given directory.
-directory :: (FilePath -> IO ()) -> FilePath -> IO ()
-directory action dir = getRecursiveContents dir >>= mapM_ action
+directory :: (FilePath -> Hakyll ()) -> FilePath -> Hakyll ()
+directory action dir = do
+ contents <- liftIO $ getRecursiveContents dir
+ mapM_ action contents
-- | Check if a cache file is still valid.
isCacheValid :: FilePath -> [FilePath] -> IO Bool