Skip to content

Commit

Permalink
fix(cli): make sure progress bar starts with space (#635)
Browse files Browse the repository at this point in the history
Signed-off-by: Salim Afiune Maya <[email protected]>
  • Loading branch information
afiune authored Dec 9, 2021
1 parent 80015b9 commit 4153f64
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cli/cmd/cli_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"os"
"reflect"
"strconv"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -291,7 +292,12 @@ func (c *cliState) StartProgress(suffix string) {
// make sure there is not a spinner already running
c.StopProgress()

c.Log.Debug("starting spinner")
// verify that the suffix starts with a space
if !strings.HasPrefix(suffix, " ") {
suffix = fmt.Sprintf(" %s", suffix)
}

c.Log.Debugw("starting spinner", "suffix", suffix)
c.spinner = spinner.New(spinner.CharSets[9], 100*time.Millisecond)
c.spinner.Suffix = suffix
c.spinner.Start()
Expand Down

0 comments on commit 4153f64

Please sign in to comment.