diff --git a/src/main/scala/net/kemitix/s3thorp/Sync.scala b/src/main/scala/net/kemitix/s3thorp/Sync.scala index a95421c..2e4ed8a 100644 --- a/src/main/scala/net/kemitix/s3thorp/Sync.scala +++ b/src/main/scala/net/kemitix/s3thorp/Sync.scala @@ -4,7 +4,6 @@ import java.io.File import java.time.Instant import cats.effect._ -import net.kemitix.s3thorp.Main.putStrLn import net.kemitix.s3thorp.Sync.{Bucket, LocalFile, RemoteKey} import net.kemitix.s3thorp.awssdk.S3Client @@ -20,15 +19,13 @@ class Sync(s3Client: S3Client) override def upload(localFile: LocalFile, bucket: Bucket, remoteKey: RemoteKey) = s3Client.upload(localFile, bucket, remoteKey) - def run(c: Config): IO[Unit] = for { - _ <- putStrLn(s"Bucket: ${c.bucket}, Prefix: ${c.prefix}, Source: ${c.source}") - _ <- { - streamDirectoryPaths(c.source).flatMap( - enrichWithS3MetaData(c)).flatMap( - uploadRequiredFilter(c)).flatMap( - performUpload(c)).compile.drain - } - } yield () + def run(c: Config): IO[Unit] = { + println(s"Bucket: ${c.bucket}, Prefix: ${c.prefix}, Source: ${c.source}") + streamDirectoryPaths(c.source).flatMap( + enrichWithS3MetaData(c)).flatMap( + uploadRequiredFilter(c)).flatMap( + performUpload(c)).compile.drain + } }