@ -16,6 +16,7 @@ import com.github.ajalt.clikt.parameters.types.file
|
||||
import com.github.ajalt.clikt.parameters.types.long
|
||||
import com.sun.security.auth.module.UnixSystem
|
||||
import kotlinx.coroutines.coroutineScope
|
||||
import kotlinx.coroutines.joinAll
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import java.io.File
|
||||
@ -183,15 +184,19 @@ class DevCommand : CliktCommand("dev") {
|
||||
*command
|
||||
).directory(serverDir).start()
|
||||
|
||||
launch {
|
||||
val input = launch {
|
||||
process.inputStream.transferTo(System.out)
|
||||
}
|
||||
launch {
|
||||
val error = launch {
|
||||
process.errorStream.transferTo(System.err)
|
||||
}
|
||||
launch {
|
||||
val console = launch {
|
||||
System.`in`.transferTo(process.outputStream)
|
||||
}
|
||||
process.waitFor()
|
||||
input.cancel()
|
||||
error.cancel()
|
||||
console.cancel()
|
||||
joinAll(input, error, console)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user