From ef4c166a1c1c918f47ee46933beb02e3edb8569d Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Fri, 18 Dec 2009 19:38:25 +0100 Subject: Changed to a more general directory command, and added css command. --- src/Text/Hakyll/File.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Text/Hakyll/File.hs') diff --git a/src/Text/Hakyll/File.hs b/src/Text/Hakyll/File.hs index 07464ac..5bca261 100644 --- a/src/Text/Hakyll/File.hs +++ b/src/Text/Hakyll/File.hs @@ -6,7 +6,8 @@ module Text.Hakyll.File toURL, makeDirectories, getRecursiveContents, - isCacheValid + isCacheValid, + directory ) where import System.Directory @@ -46,6 +47,10 @@ getRecursiveContents topdir = do return (concat paths) where isProper = not . (== '.') . head +-- | Perform an IO action on every file in a given directory. +directory :: (FilePath -> IO ()) -> FilePath -> IO () +directory action dir = getRecursiveContents dir >>= mapM_ action + -- | Check is a cache file is still valid. isCacheValid :: FilePath -> [FilePath] -> IO Bool isCacheValid cache depends = doesFileExist cache >>= \exists -> -- cgit v1.2.3