Skip to content

Commit

Permalink
Changed example on welcome page
Browse files Browse the repository at this point in the history
  • Loading branch information
Hombre-x committed Aug 19, 2024
1 parent 6f7356f commit ac86914
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ac86914

Please sign in to comment.