import: Skip .git directories.

This commit is contained in:
Joey Hess 2013-10-07 13:03:05 -04:00
parent ac26b70809
commit 45aed381df
5 changed files with 10 additions and 3 deletions

View file

@ -60,7 +60,8 @@ withPathContents :: ((FilePath, FilePath) -> CommandStart) -> CommandSeek
withPathContents a params = map a . concat <$> liftIO (mapM get params)
where
get p = ifM (isDirectory <$> getFileStatus p)
( map (\f -> (f, makeRelative (parentDir p) f)) <$> dirContentsRecursive p
( map (\f -> (f, makeRelative (parentDir p) f))
<$> dirContentsRecursiveSkipping (".git" `isSuffixOf`) p
, return [(p, takeFileName p)]
)