[sync] Extract Sync class
This commit is contained in:
parent
cc538b803a
commit
aab2fdde3d
2 changed files with 13 additions and 6 deletions
|
@ -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] =
|
||||
|
|
12
src/main/scala/net/kemitix/s3thorp/Sync.scala
Normal file
12
src/main/scala/net/kemitix/s3thorp/Sync.scala
Normal 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 ()
|
||||
|
||||
}
|
Loading…
Reference in a new issue