[S3Thorp] Extract class

This commit is contained in:
Paul Campbell 2019-05-05 19:36:04 +01:00
parent 9f7cb86c51
commit 9fa2bfea24
2 changed files with 16 additions and 1 deletions

View file

@ -8,7 +8,7 @@ object Main extends IOApp {
override def run(args: List[String]): IO[ExitCode] = override def run(args: List[String]): IO[ExitCode] =
(for { (for {
ec <- IO(println("S3Thorp - hashed sync for s3")).as(ExitCode.Success) ec <- S3Thorp(args).as(ExitCode.Success)
} yield ec).guaranteeCase { } yield ec).guaranteeCase {
case Canceled => IO(println("Interrupted")) case Canceled => IO(println("Interrupted"))
case Error(e) => IO(println("ERROR: " + e)) case Error(e) => IO(println("ERROR: " + e))

View file

@ -0,0 +1,15 @@
package net.kemitix.s3thorp
import cats.effect.IO
object S3Thorp {
def putStrLn(value: String): IO[Unit] = IO(println(value))
def apply(args: List[String]): IO[Unit] = {
for {
_ <- putStrLn("S3Thorp - hashed sync for s3")
} yield ()
}
}