packer: replace stdout/stderr after StartWithUi

This just kind of shields the error with StartWithUi if we retry
pull/270/head
Mitchell Hashimoto 13 years ago
parent 049dc5bff5
commit 7d9c7530be

@ -72,6 +72,14 @@ func (r *RemoteCmd) StartWithUi(c Communicator, ui Ui) error {
defer stdout_w.Close()
defer stderr_w.Close()
// Retain the original stdout/stderr that we can replace back in.
originalStdout := r.Stdout
originalStderr := r.Stderr
defer func() {
r.Stdout = originalStdout
r.Stderr = originalStderr
}()
// Set the writers for the output so that we get it streamed to us
if r.Stdout == nil {
r.Stdout = stdout_w

Loading…
Cancel
Save