Add Dev Command
All checks were successful
SteamWarCI Build successful

This commit is contained in:
2025-10-25 23:47:57 +02:00
parent b04c220313
commit 27cc833c46

View File

@ -185,21 +185,18 @@ class DevCommand : CliktCommand("dev") {
).directory(serverDir).start() ).directory(serverDir).start()
val input = launch { val input = launch {
val reader = process.inputReader()
while (process.isAlive) { while (process.isAlive) {
reader.readLine()?.let { echo(it) } process.inputStream.transferTo(System.out)
} }
} }
val error = launch { val error = launch {
val reader = process.errorReader()
while (process.isAlive) { while (process.isAlive) {
reader.readLine()?.let { echo(it) } process.errorStream.transferTo(System.err)
} }
} }
val console = launch { val console = launch {
val write = process.outputStream.writer()
while (process.isAlive) { while (process.isAlive) {
readlnOrNull()?.let { write.write(it + "\n") } System.`in`.transferTo(process.outputStream)
} }
} }
process.waitFor() process.waitFor()