From 24fdc0c193c34e3d7e14a6e4715bc21c19bc3c81 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 11 Dec 2023 13:12:22 -0500 Subject: [PATCH] Improve output of multi-line stderr from local command (#6282) * Better format for multi-line stderr output in localcmd Signed-off-by: Daniel Nephin * Update internal/tiltfile/files.go Co-authored-by: Daniel Nephin --------- Signed-off-by: Daniel Nephin Co-authored-by: Nick Santos --- internal/tiltfile/files.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/tiltfile/files.go b/internal/tiltfile/files.go index 919c4fbd4d..1c74dde8f6 100644 --- a/internal/tiltfile/files.go +++ b/internal/tiltfile/files.go @@ -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())