packer/plugin: trim whitespace on right of log data from plugin

This commit is contained in:
Mitchell Hashimoto 2013-07-31 09:37:03 -07:00
parent f2f69e6f7b
commit 00338a0b85
1 changed files with 4 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import (
"strings"
"sync"
"time"
"unicode"
)
// This is a slice of the "managed" clients which are cleaned up when
@ -306,8 +307,10 @@ func (c *Client) logStderr(r io.Reader) {
for {
line, err := bufR.ReadString('\n')
if line != "" {
log.Printf("%s: %s", c.config.Cmd.Path, line)
c.config.Stderr.Write([]byte(line))
line = strings.TrimRightFunc(line, unicode.IsSpace)
log.Printf("%s: %s", c.config.Cmd.Path, line)
}
if err == io.EOF {