fix(summer): send a delegate's stderr to the root's error writer through bonfire.ErrWriter (IN-13, quick-261028-rqd)

This commit is contained in:
Jakub Zych
2026-10-28 20:50:39 +01:00
parent f3f87f3cc4
commit 4914cade5a
8 changed files with 145 additions and 29 deletions

View File

@@ -150,13 +150,14 @@ func runAppBinary(ctx context.Context, argv []string, out bonfire.Output) error
// streams, so it sees the terminal: it asks the production question, prints
// styled summaries and animates its widgets. Otherwise its stdout goes
// through out (tests and bonfire.Call roots capture it) and its stderr to
// summer's stderr, so log lines and error blocks never mix into data such
// as --json output.
// the root's error stream (bonfire.ErrWriter), which is os.Stderr for the
// real summer, so log lines and error blocks never mix into data such as
// --json output, and a root built on buffers captures them.
func appStreams(out bonfire.Output, terminal bool) (stdout, stderr io.Writer) {
if terminal {
return os.Stdout, os.Stderr
}
return out, os.Stderr
return out, bonfire.ErrWriter(out)
}
// runAppCmd runs cmd, the app binary started with argv, forwarding SIGINT