Skip to content

Commit

Permalink
progress: only clear when no static message is set
Browse files Browse the repository at this point in the history
On add mpb.BarClearOnComplete() when no static message is set.
Otherwise, the message will immediatly be clear, dropping the
"skipped: already present" message.

Signed-off-by: Valentin Rothberg <[email protected]>
  • Loading branch information
vrothberg committed Apr 17, 2019
1 parent c9ecbf2 commit 8d054c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/progress/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func (p *Pool) AddBar(action string, size int64, options BarOptions) *Bar {
var bar *mpb.Bar

mpbOptions := []mpb.BarOption{
mpb.BarClearOnComplete(),
mpb.PrependDecorators(
decor.Name(action),
),
Expand All @@ -86,6 +85,7 @@ func (p *Pool) AddBar(action string, size int64, options BarOptions) *Bar {
decor.OnComplete(decor.CountersKibiByte("%.1f / %.1f"), " "+options.OnCompletionMessage),
),
)
mpbOptions = append(mpbOptions, mpb.BarClearOnComplete())
bar = p.pool.AddBar(size, mpbOptions...)
} else {
barFiller := mpb.FillerFunc(
Expand Down

0 comments on commit 8d054c2

Please sign in to comment.