command: prov UI should trim only right spaces

This commit is contained in:
Mitchell Hashimoto 2014-10-12 09:59:08 -07:00
parent 06889b8fc7
commit c6a165f8c6
1 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import (
"sort" "sort"
"strings" "strings"
"sync" "sync"
"unicode"
"github.com/hashicorp/terraform/terraform" "github.com/hashicorp/terraform/terraform"
"github.com/mitchellh/cli" "github.com/mitchellh/cli"
@ -177,7 +178,8 @@ func (h *UiHook) ProvisionOutput(
s := bufio.NewScanner(strings.NewReader(msg)) s := bufio.NewScanner(strings.NewReader(msg))
s.Split(scanLines) s.Split(scanLines)
for s.Scan() { for s.Scan() {
if line := strings.TrimSpace(s.Text()); line != "" { line := strings.TrimRightFunc(s.Text(), unicode.IsSpace)
if line != "" {
buf.WriteString(fmt.Sprintf("%s%s\n", prefix, line)) buf.WriteString(fmt.Sprintf("%s%s\n", prefix, line))
} }
} }