Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active May 25, 2024 10:20
Show Gist options
  • Save dacr/b5f9308ecffc30d6ef772ce9715a65e7 to your computer and use it in GitHub Desktop.
Save dacr/b5f9308ecffc30d6ef772ce9715a65e7 to your computer and use it in GitHub Desktop.
ZIO learning - dealing with command and processes / published by https://github.com/dacr/code-examples-manager #6d6bf8a9-0344-460e-b54c-13f58adbd733/ec1406c052573baedb7128f6c11da170167a8f0e
// summary : ZIO learning - dealing with command and processes
// keywords : scala, zio, learning, process, commands, pure-functional, @testable
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// id : 6d6bf8a9-0344-460e-b54c-13f58adbd733
// created-on : 2022-01-07T16:04:10+01:00
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file
// ---------------------
//> using scala "3.4.2"
//> using dep "dev.zio::zio:2.0.13"
//> using dep "dev.zio::zio-process:0.7.2"
// ---------------------
import zio.*
import zio.process.*
object Encapsulated extends ZIOAppDefault:
def run =
for
lines <- Command("echo", "Hello world").lines
_ <- Console.printLine(lines.mkString("\n"))
yield ()
Encapsulated.main(Array.empty)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment