[s3uploader] simplify logging

This commit is contained in:
Paul Campbell 2019-05-10 08:29:59 +01:00
parent b61499ed8f
commit be266e0d41

View file

@ -13,13 +13,13 @@ trait S3Uploader
def performUpload(c: Config): File => Stream[IO, Unit] = { def performUpload(c: Config): File => Stream[IO, Unit] = {
val remoteKey = generateKey(c) _ val remoteKey = generateKey(c) _
file => file => {
val key = remoteKey(file)
val shortFile = c.source.toPath.relativize(file.toPath)
Stream.eval(for { Stream.eval(for {
_ <- putStrLn(s"uploading: $file") _ <- putStrLn(s"Uploading: $shortFile")
key = remoteKey(file)
_ <- upload(file, c.bucket, key) _ <- upload(file, c.bucket, key)
_ <- putStrLn(s"uploaded: ${c.bucket}/$key")
} yield ()) } yield ())
} }
}
} }