Add Dev Command
All checks were successful
SteamWarCI Build successful

This commit is contained in:
2025-10-25 23:49:02 +02:00
parent 27cc833c46
commit 4a073c8b96

View File

@ -182,29 +182,7 @@ class DevCommand : CliktCommand("dev") {
echo(command.joinToString(" "))
val process = ProcessBuilder(
*command
).directory(serverDir).start()
val input = launch {
while (process.isAlive) {
process.inputStream.transferTo(System.out)
}
}
val error = launch {
while (process.isAlive) {
process.errorStream.transferTo(System.err)
}
}
val console = launch {
while (process.isAlive) {
System.`in`.transferTo(process.outputStream)
}
}
).directory(serverDir).inheritIO().start()
process.waitFor()
input.cancel()
error.cancel()
console.cancel()
joinAll(input, error, console)
echo("Process finished with exit code ${process.exitValue()}")
process.errorStream.transferTo(System.err)
}
}