Wait on stream redirect futures (update helper task)

This commit is contained in:
Jason Penilla 2023-12-06 15:32:08 -07:00
parent 6bafacfb14
commit ada77b3a3b
No known key found for this signature in database
GPG Key ID: 0E75A301420E48F8
1 changed files with 4 additions and 2 deletions

View File

@ -207,9 +207,10 @@ abstract class RebasePatches : BaseTask() {
.redirectErrorStream(true)
.start()
redirect(proc.inputStream, out)
val f = redirect(proc.inputStream, out)
val exit = proc.waitFor()
f.get()
if (exit != 0) {
val outStr = String(out.toByteArray())
@ -251,8 +252,9 @@ abstract class RebasePatches : BaseTask() {
.redirectErrorStream(true)
.start()
redirect(apply2.inputStream, System.out)
val f1 = redirect(apply2.inputStream, System.out)
apply2.waitFor()
f1.get()
logger.lifecycle(outStr)
logger.lifecycle("Patch failed at $failed; See Git output above.")