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