Kommons is a set of Kotlin Multiplatform Libraries (MPP) to allow the execution of command lines / scripts, to support print debugging and to ease testing.
MIT License
Bot releases are hidden (Show)
Published by bkahlert about 3 years ago
This is a test release to check if the new workflow works.
Published by bkahlert about 3 years ago
Published by bkahlert about 3 years ago
Published by bkahlert over 3 years ago
public object Wizards : Category() {
public val `(ノ>ω<)ノ﹕・゚’★,。・﹕*﹕・゚’☆`: Kaomoji by parts("(ノ", ">", "ω", "<", ")ノ", " :。・:*:・゚’★,。・:*:・゚’☆")
public val `(# ̄_ ̄)o︠・━・・━・━━・━☆`: Kaomoji by parts(0..1, 2..2, 3..3, 4..4, 5..7, 8..18)
public val `(/ ̄‿ ̄)/~~☆’․・․・﹕★’․・․・﹕☆`: Kaomoji by parts("(/", " ̄", "‿", " ̄", ")/", "~~☆’.・.・:★’.・.・:☆")
public val `(∩ᄑ_ᄑ)⊃━☆゚*・。*・﹕≡( ε﹕)`: Kaomoji by parts("(∩", "ᄑ", "_", "ᄑ", ")⊃", "━☆゚*・。*・:≡( ε:)")
public val `(ノ ˘_˘)ノ ζζζ ζζζ ζζζ`: Kaomoji by parts(0..2, 3..3, 4..4, 5..5, 6..7, 8..21)
public val `(ノ°∀°)ノ⌒・*﹕․。․ ․。․﹕*・゜゚・*☆`: Kaomoji by parts("(ノ", "°", "∀", "°", ")ノ", "⌒・*:.。. .。.:*・゜゚・*☆")
public val `(⊃。•́‿•̀。)⊃━✿✿✿✿✿✿`: Kaomoji by parts(0..2, 3..4, 5..5, 6..7, 8..10, 11..17)
public val `ଘ(੭ˊᵕˋ)੭* ੈ✩‧₊˚`: Kaomoji by parts(0..2, 3..3, 4..4, 5..5, 6..7, 8..14)
}
Published by bkahlert over 3 years ago
CommandLine("printenv", "HOME").exec()
ShellScript { "printenv | grep HOME | perl -pe 's/.*?HOME=//'" }.exec()
ShellScript { … }.exec()
ShellScript { … }.exec.logging()
Process {PID} terminated with exit code {…}
➜ A dump has been written to:
- {WorkDir}/koodies.dump.{}.log
- {WorkDir}/koodies.dump.{}.ansi-removed.log
➜ The last 10 lines are:
{…}
3
2
1
Boom!
ShellScript { … }.exec.processing { io -> doSomething(io) }
io
is typed; simply use io is IO.Output
to filter out errors and meta informationShellScript { … }.exec()
ShellScript { … }.exec.async()
ShellScript { … }.exec()
ShellScript { … }.dockerized{ "bkahlert" / "libguestfs" }.exec()
Whatever variant you choose, life-cycle events, sent input, the process's output and errors are stored for you:
CommandLine(…).exec().io
CommandLine(…).exec().io.output
CommandLine(…).exec().io.error.ansiRemoved
state
, which is either an instance of Running
, Exited
Succeeded
and Failed
) or Excepted
.with(tempDir()) {
SvgFile.copyTo(resolve("koodies.svg"))
// convert SVG to PNG using command line-style docker command
docker("minidocks/librsvg", "-z", 5, "--output", "koodies.png", "koodies.svg")
resolve("koodies.png") asserting { exists() }
// convert PNG to ASCII art using shell script-style docker command
docker("rafib/awesome-cli-binaries", logger = null) {
"""
/opt/bin/chafa -c full -w 9 koodies.png
"""
}.io.output.ansiKept.let { println(it.resetLines()) }
}
&kyTTTTTTTTTTTTTTTTTTTTuvvvvvvvvvvvvvvvvvvvvvvvv\.
RR&kyTTTTTTTTTTTTTTTTTvvvvvvvvvvvvvvvvvvvvvvvv\.
BBRR&kyTTTTTTTTTTTTTvvvvvvvvvvvvvvvvvvvvvvvv\.
BBBBRR&kyTTTTTTTTTvvvvvvvvvvvvvvvvvvvvvvvv\.
BBBBBBRR&kyTTTTTvvvvvvvvvvvvvvvvvvvvvvvv\.
BBBBBBBBRR&kyTx}vvvvvvvvvvvvvvvvvvvvvv\.
BBBBBBBBBBRZT}vvvvvvvvvvvvvvvvvvvvvv\.
BBBBBBBBBBQxvvvvvvvvvvvvvvvvvvvvvv\.
BBBBBBBB&xvvvvvvvvvvvvvvvvvvvvvv\.
BBBBBBZzvvvvvvvvvvvvvvvvvvvvvv\.
BBBBZuvvvvvvvvvvvvvvvvvvvvvv▗▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
BBZTvvvvvvvvvvvvvvvvvvvvvv\.▝▜MMMMMMMMMMMMMMMMMMMM
R3vvvvvvvvvvvvvvvvvvvvvv\. .▝▜MMMMMMMMMMMMMMMMMM
vvvvvvvvvvvvvvvvvvvvvv\. .▝▜MMMMMMMMMMMMMMMM
vvvvvvvvvvvvvvvvvvvv\. .▝▜MMMMMMMMMMMMMM
uxvvvvvvvvvvvvvvvvz3x_ ▝▜MMMMMMMMMMMM
▁3uxvvvvvvvvvvvv▁▅&▆▂gx` ▝▜MMMMMMMMMM
Z▅▁3uxvvvvvvvvz▆WWRZ&▆▂gv. `▀WMMMMMMMM
WR&▄▁3uxvvvvvuk▀BWWWRZ&▆▂gv. .\vvz▀WMMMMMM
WWWRZ▅▁3ux▁▂Zg33k▀BWWWRZ&▆▂g}. .\vvvvvvz▀WMM0W
000WWRZ▅▃▆MM▆▂Zg33k▀BWWWRZ&▆▂g}. .\vvvvvvvvvvx▀BBR
00000WMMMMMMMM▆▂Zg33k▀BWWWRZ&▆▂yxxvvvvvvvvvvvvvx▝▀
0000MMMMMMMMMMMM▆▂Zg33k▀BWWWRZ▆▆▂gTxvvvvvvvvvvvvvx
00MMMMMMMMMMMMMMMM▆▂Zg33k▀BWWWRZ&▆▂gTxvvvvvvvvvvvv
MMMMMMMMMMMMMMMMMMMM▆▂Zg33g▀BWWWRZ&▆▂gTxvvvvvvvvvv
docker
, ubuntu
, busybox
, curl
, download
, …) use the path in the receiver to
start
, run
, stop
, kill
, remove
, search
, image
, ps
engineRunning
, info
, images
, containers
, search
, exec
list
, isPulled
, pull
, tagsOnDockerHub
start
, stop
, state
, kill
, remove
Published by bkahlert almost 4 years ago
Published by bkahlert almost 4 years ago