[sync] Extract Sync class

This commit is contained in:
Paul Campbell 2019-05-06 17:20:28 +01:00
parent cc538b803a
commit aab2fdde3d
2 changed files with 13 additions and 6 deletions

View file

@ -7,16 +7,11 @@ object Main extends IOApp {
def putStrLn(value: String) = IO { println(value) }
def sync(c: Config): IO[Unit] =
for {
_ <- putStrLn(s"Bucket: ${c.bucket}, Prefix: ${c.prefix}, Source: ${c.source}")
} yield ()
def program(args: List[String]): IO[ExitCode] =
for {
_ <- putStrLn("S3Thorp - hashed sync for s3")
a <- ParseArgs(args)
_ <- sync(a)
_ <- Sync(a)
} yield ExitCode.Success
override def run(args: List[String]): IO[ExitCode] =

View file

@ -0,0 +1,12 @@
package net.kemitix.s3thorp
import cats._
import cats.effect._
import Main.putStrLn
object Sync {
def apply(c: Config): IO[Unit] = for {
_ <- putStrLn(s"Bucket: ${c.bucket}, Prefix: ${c.prefix}, Source: ${c.source}")
} yield ()
}