fix: add showLastProgressBar (#4855)
This commit is contained in:
@@ -85,6 +85,7 @@ func mainGet(cliCtx *cli.Context) error {
|
||||
} else {
|
||||
pg = newAccounter(totalBytes)
|
||||
}
|
||||
defer showLastProgressBar(pg)
|
||||
go func() {
|
||||
opts := prepareCopyURLsOpts{
|
||||
sourceURLs: sourceURLs,
|
||||
|
||||
@@ -121,6 +121,7 @@ func mainPut(cliCtx *cli.Context) error {
|
||||
} else {
|
||||
pg = newAccounter(totalBytes)
|
||||
}
|
||||
defer showLastProgressBar(pg)
|
||||
go func() {
|
||||
opts := prepareCopyURLsOpts{
|
||||
sourceURLs: sourceURLs,
|
||||
@@ -173,3 +174,13 @@ func printPutURLsError(putURLs *URLs) {
|
||||
"Unable to upload.")
|
||||
}
|
||||
}
|
||||
|
||||
func showLastProgressBar(pg ProgressReader) {
|
||||
if progressReader, ok := pg.(*progressBar); ok {
|
||||
progressReader.ProgressBar.Finish()
|
||||
} else {
|
||||
if accntReader, ok := pg.(*accounter); ok {
|
||||
printMsg(accntReader.Stat())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user