@@ -25,12 +25,13 @@ makeDirectories = createDirectoryIfMissing True . takeDirectory
2525
2626--------------------------------------------------------------------------------
2727-- | Get all contents of a directory.
28−getRecursiveContents :: FilePath -- ^ Directory to search
29− -> IO [FilePath] -- ^ List of files found
30−getRecursiveContents top = go ""
28+getRecursiveContents :: (FilePath -> Bool) -- ^ Ignore this file/directory
29+ -> FilePath -- ^ Directory to search
30+ -> IO [FilePath] -- ^ List of files found
31+getRecursiveContents ignore top = go ""
3132 where
32− isProper = (`notElem` [".", ".."])
33− go dir = do
33+ isProper x = notElem x [".", ".."] && not (ignore x)
34+ go dir = do
3435 dirExists <- doesDirectoryExist (top </> dir)
3536 if not dirExists
3637 then return []