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