Fix unmigrated offer
This commit is contained in:
@@ -102,15 +102,21 @@ class ProcessListener(private val terminateRegex: Regex,
|
|||||||
try {
|
try {
|
||||||
launch(parent) {
|
launch(parent) {
|
||||||
try {
|
try {
|
||||||
process.inputStream.bufferedReader().forEachLine {
|
process.inputStream.bufferedReader().useLines {
|
||||||
trySend(ProcessData.StdoutLine(it)).onClosed { return@forEachLine }.onFailure { throw it!! }
|
for (line in it) {
|
||||||
if (terminateRegex.containsMatchIn(it)) process.destroy()
|
trySend(ProcessData.StdoutLine(line)).onClosed { return@useLines }.onFailure { throw it!! }
|
||||||
|
if (terminateRegex.containsMatchIn(line)) process.destroy()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (_: InterruptedIOException) { }
|
} catch (_: InterruptedIOException) { }
|
||||||
}
|
}
|
||||||
launch(parent) {
|
launch(parent) {
|
||||||
try {
|
try {
|
||||||
process.errorStream.bufferedReader().forEachLine { check(offer(ProcessData.StderrLine(it))) }
|
process.errorStream.bufferedReader().useLines {
|
||||||
|
for (line in it) trySend(ProcessData.StdoutLine(line)).onClosed {
|
||||||
|
return@useLines
|
||||||
|
}.onFailure { throw it!! }
|
||||||
|
}
|
||||||
} catch (_: InterruptedIOException) { }
|
} catch (_: InterruptedIOException) { }
|
||||||
}
|
}
|
||||||
launch(parent) {
|
launch(parent) {
|
||||||
|
|||||||
Reference in New Issue
Block a user