From c35b3813bbcf6a1497b2d9c1264c4d73d1ed6d25 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 16 Jul 2018 19:59:10 -0700 Subject: [PATCH] Fix missing errors during lunch Bug: 111499523 Test: lunch foo Test: m nothing 2>/dev/null Change-Id: Ife888d4b731bc0a0dd253ac0c8c97d6c37593d73 --- cmd/soong_ui/main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/soong_ui/main.go b/cmd/soong_ui/main.go index e2f25b8f2..47682ff56 100644 --- a/cmd/soong_ui/main.go +++ b/cmd/soong_ui/main.go @@ -46,7 +46,15 @@ func inList(s string, list []string) bool { } func main() { - writer := terminal.NewWriter(terminal.StdioImpl{}) + var stdio terminal.StdioInterface + stdio = terminal.StdioImpl{} + + // dumpvar uses stdout, everything else should be in stderr + if os.Args[1] == "--dumpvar-mode" || os.Args[1] == "--dumpvars-mode" { + stdio = terminal.NewCustomStdio(os.Stdin, os.Stderr, os.Stderr) + } + + writer := terminal.NewWriter(stdio) defer writer.Finish() log := logger.New(writer)