Fix missing errors during lunch

Bug: 111499523
Test: lunch foo
Test: m nothing 2>/dev/null
Change-Id: Ife888d4b731bc0a0dd253ac0c8c97d6c37593d73
This commit is contained in:
Dan Willemsen 2018-07-16 19:59:10 -07:00
parent f5531d2ed6
commit c35b3813bb

View file

@ -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)