summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Util/File.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2013-02-14 10:08:21 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2013-02-14 10:08:21 +0100
commit61dcb5f454fcbd912b09839021f4c79ca60973fe (patch)
tree37b39b20bc3f5325d2c13939c03ce286162eb354 /src/Hakyll/Core/Util/File.hs
parent2912fcd521d0d9fbe93dae37783f5f379893ddb1 (diff)
parent02a92d54cdee8299aac0f55cbe4a930ac5060d20 (diff)
downloadhakyll-61dcb5f454fcbd912b09839021f4c79ca60973fe.tar.gz
Merge branch 'master' into dev-metadata-route
Diffstat (limited to 'src/Hakyll/Core/Util/File.hs')
-rw-r--r--src/Hakyll/Core/Util/File.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Hakyll/Core/Util/File.hs b/src/Hakyll/Core/Util/File.hs
index 0e34d7c..20cfbbc 100644
--- a/src/Hakyll/Core/Util/File.hs
+++ b/src/Hakyll/Core/Util/File.hs
@@ -25,12 +25,13 @@ makeDirectories = createDirectoryIfMissing True . takeDirectory
--------------------------------------------------------------------------------
-- | Get all contents of a directory.
-getRecursiveContents :: FilePath -- ^ Directory to search
- -> IO [FilePath] -- ^ List of files found
-getRecursiveContents top = go ""
+getRecursiveContents :: (FilePath -> Bool) -- ^ Ignore this file/directory
+ -> FilePath -- ^ Directory to search
+ -> IO [FilePath] -- ^ List of files found
+getRecursiveContents ignore top = go ""
where
- isProper = (`notElem` [".", ".."])
- go dir = do
+ isProper x = notElem x [".", ".."] && not (ignore x)
+ go dir = do
dirExists <- doesDirectoryExist (top </> dir)
if not dirExists
then return []