[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] = {
val remoteKey = generateKey(c) _
file =>
file => {
val key = remoteKey(file)
val shortFile = c.source.toPath.relativize(file.toPath)
Stream.eval(for {
_ <- putStrLn(s"uploading: $file")
key = remoteKey(file)
_ <- putStrLn(s"Uploading: $shortFile")
_ <- upload(file, c.bucket, key)
_ <- putStrLn(s"uploaded: ${c.bucket}/$key")
} yield ())
}
}
}