Skip to content

Commit

Permalink
extract: Ignore stderr for programs run with --extract-pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
rtpt-alexanderneumann authored and rtpt-erikgeiser committed Jun 20, 2023
1 parent a378be4 commit f1c0fe6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion response/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,13 @@ func extractCommand(ctx context.Context, extraEnv []string, buf []byte, cmds [][
if len(command) < 1 {
panic("command is invalid")
}

cmd := exec.CommandContext(ctx, command[0], command[1:]...)
cmd.Stdin = bytes.NewReader(buf)
cmd.Stderr = os.Stderr

// we throw away stderr here so that it does not break the output
cmd.Stderr = io.Discard

cmd.Env = append(os.Environ(), extraEnv...)

buf, err := cmd.Output()
Expand Down

0 comments on commit f1c0fe6

Please sign in to comment.