Merge pull request #2169 from cbednarski/b-communicator-test-failure
Prevent select from spewing garbage to the terminal
This commit is contained in:
commit
e8b7c10025
|
@ -1,11 +1,12 @@
|
||||||
package packer
|
package packer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/mitchellh/iochan"
|
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/mitchellh/iochan"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RemoteCmd represents a remote command being prepared or run.
|
// RemoteCmd represents a remote command being prepared or run.
|
||||||
|
@ -132,9 +133,13 @@ OutputLoop:
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case output := <-stderrCh:
|
case output := <-stderrCh:
|
||||||
|
if output != "" {
|
||||||
ui.Message(r.cleanOutputLine(output))
|
ui.Message(r.cleanOutputLine(output))
|
||||||
|
}
|
||||||
case output := <-stdoutCh:
|
case output := <-stdoutCh:
|
||||||
|
if output != "" {
|
||||||
ui.Message(r.cleanOutputLine(output))
|
ui.Message(r.cleanOutputLine(output))
|
||||||
|
}
|
||||||
case <-exitCh:
|
case <-exitCh:
|
||||||
break OutputLoop
|
break OutputLoop
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue