DEPRECATED see jakubriegel/kotlin-shell
Kotlin Shell Extension
get it
repositories {
maven("https://dl.bintray.com/jakubriegel/KotlinShell")
}
dependencies {
implementation("eu.jrie.jetbrains:kotlin-shellextension:0.2")
}
Kotlin Shell Extension features slf4j logging. To use it add logging implementation or NOP logger to turn it off:
implementation("org.slf4j:slf4j-nop:1.7.26")
usage
writing scripts
with new coroutine scope:
shell {
"echo hello world!"()
}
with given scope:
shell (
scope = myScope
) {
"echo hello world!"()
}
processes
starting system process with dsl:
val echo = systemProcess {
cmd { "echo" withArg "hello" }
}
echo()
starting system with extensions:
val echo = "echo hello".process()
echo()
or simply:
"echo hello"()
pipelines
process1 pipe process2 pipe process3