@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user