From a7927e8e13c77846379e2496bf0487191a35d6da Mon Sep 17 00:00:00 2001 From: dpoluyanov Date: Fri, 17 Dec 2021 21:15:24 +0300 Subject: [PATCH] fix: do not patch output for run command --- main.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index ad35441..0729906 100644 --- a/main.go +++ b/main.go @@ -85,6 +85,9 @@ func main() { } else if strings.HasPrefix(arg, "build-language") { patchOutputBuffer = false bazelArgs = append(bazelArgs, arg) + } else if strings.TrimSpace(arg) == "run" { + patchOutputBuffer = false + bazelArgs = append(bazelArgs, arg) } else { bazelArgs = append(bazelArgs, arg) } @@ -103,7 +106,11 @@ func main() { var outBuffer bytes.Buffer cmd := exec.Command("wsl", bazelArgs...) - cmd.Stdout = &outBuffer + if patchOutputBuffer { + cmd.Stdout = &outBuffer + } else { + cmd.Stdout = os.Stdout + } cmd.Stderr = os.Stderr cmdErr := cmd.Run() @@ -111,8 +118,6 @@ func main() { if patchOutputBuffer { var patchedBuffer = PatchBuffer(&outBuffer) os.Stdout.Write(patchedBuffer.Bytes()) - } else { - os.Stdout.Write(outBuffer.Bytes()) } if bepOutputPath != "" && bepIDEAOutputPath != "" {