Skip to content

iseki0/cmdpipe

Repository files navigation

cmdpipe

Maven Central

Utils for command line call

Example

val r = cmdline("git", "clone", "https://github.com/iseki0/cmdpipe")
    .withWorkingDirectory(File("/dit/to/clone"))
    .handleStdout { input -> input.reader().readText() }
    .withTimeout(30_000)
    .execute()
check(r.exitCode == 0) { "Clone failed" }
println("stdout: ${r.stdoutValue}") // because we `readText`, so here's the text
println("stderr: ${r.stderrSnapshot}")