From 60955d8c2c8a148687b48daf1066e0e431b518fd Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Thu, 9 Feb 2017 17:41:42 -0800 Subject: [PATCH] don't show ui color if we're not colorized --- command/build.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/command/build.go b/command/build.go index 3d9a29ded..5aafa8620 100644 --- a/command/build.go +++ b/command/build.go @@ -92,10 +92,12 @@ func (c BuildCommand) Run(args []string) int { Color: colors[i%len(colors)], Ui: ui, } + if _, ok := c.Ui.(*packer.MachineReadableUi); !ok { + ui.Say(fmt.Sprintf("%s output will be in this color.", b)) + } } buildUis[b] = ui - ui.Say(fmt.Sprintf("%s output will be in this color.", b)) } // Add a newline between the color output and the actual output