Add Dev Command
All checks were successful
SteamWarCI Build successful

This commit is contained in:
2025-10-25 23:43:40 +02:00
parent e137d5b861
commit 106fc2e1ed

View File

@ -185,13 +185,15 @@ 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) {
process.inputStream.transferTo(System.out) reader.readLine()?.let { echo(it) }
} }
} }
val error = launch { val error = launch {
val reader = process.errorReader()
while (process.isAlive) { while (process.isAlive) {
process.errorStream.transferTo(System.err) reader.readLine()?.let { echo(it) }
} }
} }
val console = launch { val console = launch {
@ -205,5 +207,7 @@ class DevCommand : CliktCommand("dev") {
error.cancel() error.cancel()
console.cancel() console.cancel()
joinAll(input, error, console) joinAll(input, error, console)
echo("Process finished with exit code ${process.exitValue()}")
process.errorStream.transferTo(System.err)
} }
} }