@@ -21,6 +21,7 @@ import (
2121 "io"
2222 "sync"
2323
24+ humanize "github.com/dustin/go-humanize"
2425 ocispec "github.com/opencontainers/image-spec/specs-go/v1"
2526 mpbv8 "github.com/vbauerster/mpb/v8"
2627 "github.com/vbauerster/mpb/v8/decor"
@@ -59,15 +60,15 @@ func (p *ProgressBar) Add(prompt string, desc ocispec.Descriptor, reader io.Read
5960 // create a new bar if it does not exist.
6061 bar := p .mpb .New (desc .Size ,
6162 mpbv8 .BarStyle ().Rbound ("|" ),
62- mpbv8 .BarFillerClearOnComplete ( ),
63+ mpbv8 .BarFillerOnComplete ( "|" ),
6364 mpbv8 .PrependDecorators (
6465 decor .Name (fmt .Sprintf ("%s%s" , prompt , desc .Digest .String ())),
6566 ),
6667 mpbv8 .AppendDecorators (
67- decor .Counters (decor .SizeB1024 (0 ), "% .2f / % .2f" ),
68- decor .Name (" ] " ),
68+ decor .OnComplete ( decor . Counters (decor .SizeB1024 (0 ), "% .2f / % .2f" ), humanize . Bytes ( uint64 ( desc . Size )) ),
69+ decor .OnComplete ( decor . Name (" | " ), " | " ),
6970 decor .OnComplete (
70- decor .EwmaSpeed (decor .SizeB1024 (0 ), "% .2f" , 30 ), "done" ,
71+ decor .AverageSpeed (decor .SizeB1024 (0 ), "% .2f" ), "done" ,
7172 ),
7273 ),
7374 )
0 commit comments