Add Dev Command
All checks were successful
SteamWarCI Build successful

This commit is contained in:
2025-10-25 23:41:44 +02:00
parent a2bb90a116
commit e137d5b861

View File

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