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()
val input = launch {
process.inputStream.transferTo(System.out)
while (process.isAlive) {
process.inputStream.transferTo(System.out)
}
}
val error = launch {
process.errorStream.transferTo(System.err)
while (process.isAlive) {
process.errorStream.transferTo(System.err)
}
}
val console = launch {
System.`in`.transferTo(process.outputStream)
val write = process.outputStream.writer()
while (process.isAlive) {
readlnOrNull()?.let { write.write(it + "\n") }
}
}
process.waitFor()
input.cancel()