Skip to content

Commit

Permalink
fix: do not patch output for run command
Browse files Browse the repository at this point in the history
  • Loading branch information
dpoluyanov committed Dec 17, 2021
1 parent 26f4138 commit a7927e8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -103,16 +106,18 @@ 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()

if patchOutputBuffer {
var patchedBuffer = PatchBuffer(&outBuffer)
os.Stdout.Write(patchedBuffer.Bytes())
} else {
os.Stdout.Write(outBuffer.Bytes())
}

if bepOutputPath != "" && bepIDEAOutputPath != "" {
Expand Down

0 comments on commit a7927e8

Please sign in to comment.