Skip to content

Commit 9a05507

Browse files
authored
Make progress bar more pretty (#2198)
Signed-off-by: Nikhil Sinha <[email protected]>
1 parent 955912d commit 9a05507

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pkg/monobeam/client.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"encoding/json"
66
"errors"
7+
"fmt"
78
"net/http"
89
"net/url"
910
"strconv"
@@ -96,7 +97,10 @@ func (c *Client) UploadFile(ctx context.Context, objectType string, digest strin
9697
return err
9798
}
9899

99-
console.Info("Waiting to verify the image was received by the server...")
100+
_, err = p.Write([]byte(fmt.Sprintf("Waiting to verify %s was received by the server...\n", desc)))
101+
if err != nil {
102+
console.Debugf("failed to write to progress bar: %v", err)
103+
}
100104

101105
// Begin verification
102106
verificationUrl := verificationURL(objectType, digest, data.Uuid)

tools/uploader/s3.go

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ func (s *s3Uploader) UploadObject(ctx context.Context, objectPath, bucket, key s
106106
decor.Name(" ] "),
107107
decor.EwmaSpeed(decor.SizeB1024(0), "% .2f", 30),
108108
),
109+
mpb.BarRemoveOnComplete(),
109110
)
110111
defer bar.Abort(false)
111112

0 commit comments

Comments
 (0)