From 14205f4fbf72614e0f8589bd11912d468eb88c8a Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Mon, 6 May 2019 10:37:10 +0100 Subject: [PATCH] [main] inline S3Thorp (for now) --- src/main/scala/net/kemitix/s3thorp/Main.scala | 16 ++++++++++++---- src/main/scala/net/kemitix/s3thorp/S3Thorp.scala | 15 --------------- 2 files changed, 12 insertions(+), 19 deletions(-) delete mode 100644 src/main/scala/net/kemitix/s3thorp/S3Thorp.scala diff --git a/src/main/scala/net/kemitix/s3thorp/Main.scala b/src/main/scala/net/kemitix/s3thorp/Main.scala index 54ff2cf..9ac86ea 100644 --- a/src/main/scala/net/kemitix/s3thorp/Main.scala +++ b/src/main/scala/net/kemitix/s3thorp/Main.scala @@ -7,10 +7,18 @@ object Main extends IOApp { def parseArgs(args: List[String]): IO[Config] = IO.pure(Config("", "")) - def program(args: List[String]): IO[ExitCode] = for { - a <- parseArgs(args) - _ <- S3Thorp(a) - } yield ExitCode.Success + def putStrLn(value: String) = IO { println(value) } + + def sync(c: Config): IO[Unit] = + for { + _ <- putStrLn("S3Thorp - hashed sync for s3") + } yield () + + def program(args: List[String]): IO[ExitCode] = + for { + a <- parseArgs(args) + _ <- sync(a) + } yield ExitCode.Success override def run(args: List[String]): IO[ExitCode] = program(args) diff --git a/src/main/scala/net/kemitix/s3thorp/S3Thorp.scala b/src/main/scala/net/kemitix/s3thorp/S3Thorp.scala deleted file mode 100644 index 581ce6f..0000000 --- a/src/main/scala/net/kemitix/s3thorp/S3Thorp.scala +++ /dev/null @@ -1,15 +0,0 @@ -package net.kemitix.s3thorp - -import cats.effect.IO - -object S3Thorp { - - def putStrLn(value: String) = IO { println(value) } - - def apply(args: Config): IO[Unit] = { - for { - _ <- putStrLn("S3Thorp - hashed sync for s3") - } yield () - } - -}