From ac86914dfa3315abb7983eadad988435bf361021 Mon Sep 17 00:00:00 2001 From: Hombre-x Date: Sun, 11 Aug 2024 02:13:38 -0500 Subject: [PATCH] Changed example on welcome page --- docs/index.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/index.md b/docs/index.md index dca2af6..d9aceae 100644 --- a/docs/index.md +++ b/docs/index.md @@ -15,18 +15,21 @@ libraryDependencies ++= Seq( Shellfish is a library to perform common script operations such as working with processes and files while maintaining referential transparency! ```scala 3 mdoc:reset -import cats.effect.{IO, IOApp} +import cats.effect.{IO, IOApp, ExitCode} -import shellfish.os.* +import shellfish.* +import shellfish.syntax.path.* object Main extends IOApp: def run(args: List[String]): IO[ExitCode] = - import Shell.io.* for - _ <- cd("..") - got <- ls.compile.toList - _ <- echo(got.toString) + home <- userHome + config = home / ".shellfish" / "config.conf" + _ <- config.createFile + _ <- config.write("scripting.made.easy = true") + newconfig <- config.read + _ <- IO.println(s"Loading config: $newconfig") yield ExitCode.Success end Main