Use fs2 Files api

This commit is contained in:
eikek
2021-06-22 22:48:14 +02:00
parent bd791b4593
commit 02b8078f01
2 changed files with 35 additions and 85 deletions

View File

@ -80,8 +80,7 @@ object Ocr {
)
SystemCommand
.execSuccess(cmd, logger, wd = Some(wd), stdin = pdf)
.evalMap(_ => File.listJFiles(pathEndsWith(".tif"), wd))
.flatMap(fs => Stream.emits(fs))
.flatMap(_ => File.listFiles(pathEndsWith(".tif"), wd))
}
/** Run ghostscript to extract all pdf pages into tiff files. The
@ -101,8 +100,7 @@ object Ocr {
)
SystemCommand
.execSuccess[F](cmd, logger, wd = Some(wd))
.evalMap(_ => File.listJFiles(pathEndsWith(".tif"), wd))
.flatMap(fs => Stream.emits(fs))
.flatMap(_ => File.listFiles(pathEndsWith(".tif"), wd))
}
private def pathEndsWith(ext: String): Path => Boolean =