Skip to content

Commit

Permalink
Improve output of multi-line stderr from local command (#6282)
Browse files Browse the repository at this point in the history
* Better format for multi-line stderr output in localcmd

Signed-off-by: Daniel Nephin <dnephin@gmail.com>

* Update internal/tiltfile/files.go

Co-authored-by: Daniel Nephin <dnephin@gmail.com>

---------

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
Co-authored-by: Nick Santos <nick.santos@docker.com>
  • Loading branch information
dnephin and nicks committed Dec 11, 2023
1 parent 0a2919f commit 24fdc0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/tiltfile/files.go
Expand Up @@ -120,8 +120,9 @@ func (s *tiltfileState) execLocalCmd(t *starlark.Thread, cmd model.Cmd, options
if !options.logOutput {
// if we already logged the output, don't include it in the error message to prevent it from
// getting output 2x
errMessage.WriteString(fmt.Sprintf("\nstdout: %q\nstderr: %q",
stdoutBuf.String(), stderrBuf.String()))

stdout, stderr := stdoutBuf.String(), stderrBuf.String()
fmt.Fprintf(&errMessage, "\nstdout:\n%v\nstderr:\n%v\n", stdout, stderr)
}

return "", errors.New(errMessage.String())
Expand Down

0 comments on commit 24fdc0c

Please sign in to comment.