command: prov UI should trim only right spaces
This commit is contained in:
parent
06889b8fc7
commit
c6a165f8c6
|
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue