filter non-aqua files (#246)

This commit is contained in:
Dima 2021-08-18 11:49:53 +03:00 committed by GitHub
parent 96bc76ef2a
commit f59a93ac27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,7 +107,8 @@ class AquaFilesIO[F[_]: Files: Concurrent] extends AquaIO[F] {
} else { } else {
Files[F].isDirectory(folder).flatMap { isDir => Files[F].isDirectory(folder).flatMap { isDir =>
if (isDir) { if (isDir) {
Files[F].list(folder).compile.toList.map(Right(_)) Files[F].list(folder).evalFilter(p => if (p.extName == ".aqua") true.pure[F] else Files[F].isDirectory(p))
.compile.toList.map(Right(_))
} else { } else {
Right(folder :: Nil).pure[F] Right(folder :: Nil).pure[F]
} }