From 408250ec7682a35eb5905cd49fc05e937901886b Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Wed, 3 Jun 2015 17:13:26 -0700 Subject: [PATCH] Wrap output in if statement to catch zero values from select --- packer/communicator.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packer/communicator.go b/packer/communicator.go index df7216d9c..7bfc17a68 100644 --- a/packer/communicator.go +++ b/packer/communicator.go @@ -1,11 +1,12 @@ package packer import ( - "github.com/mitchellh/iochan" "io" "os" "strings" "sync" + + "github.com/mitchellh/iochan" ) // RemoteCmd represents a remote command being prepared or run. @@ -132,9 +133,13 @@ OutputLoop: for { select { case output := <-stderrCh: - ui.Message(r.cleanOutputLine(output)) + if output != "" { + ui.Message(r.cleanOutputLine(output)) + } case output := <-stdoutCh: - ui.Message(r.cleanOutputLine(output)) + if output != "" { + ui.Message(r.cleanOutputLine(output)) + } case <-exitCh: break OutputLoop }