[main] Report Done or Interrupted on exit
This commit is contained in:
parent
a79c3320a5
commit
73f4a79254
1 changed files with 8 additions and 1 deletions
|
@ -1,11 +1,18 @@
|
||||||
package net.kemitix.s3thorp
|
package net.kemitix.s3thorp
|
||||||
|
|
||||||
|
import cats.effect.ExitCase.Canceled
|
||||||
import cats.effect.{ExitCode, IO, IOApp}
|
import cats.effect.{ExitCode, IO, IOApp}
|
||||||
import cats.syntax.all._
|
import cats.syntax.all._
|
||||||
|
|
||||||
object Main extends IOApp {
|
object Main extends IOApp {
|
||||||
|
|
||||||
override def run(args: List[String]): IO[ExitCode] =
|
def exec(args: List[String]): IO[ExitCode] =
|
||||||
IO(println("S3Thorp - hashed sync for s3")).as(ExitCode.Success)
|
IO(println("S3Thorp - hashed sync for s3")).as(ExitCode.Success)
|
||||||
|
|
||||||
|
override def run(args: List[String]): IO[ExitCode] =
|
||||||
|
exec(args).guaranteeCase {
|
||||||
|
case Canceled => IO(println("Interrupted"))
|
||||||
|
case _ => IO(println("Done"))
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue