Break transfer loops after refreshing progress bar

This commit is contained in:
2021-08-27 09:01:46 -07:00
parent 44607ba9e2
commit 419b2f5a79
2 changed files with 8 additions and 8 deletions

View File

@@ -95,14 +95,14 @@ var upgradeCmd = &cobra.Command{
if err != nil {
log.Fatal().Err(err).Msg("Error decoding response data")
}
// If transfer finished, break
if event.Received == event.Total {
break
}
// Set total bytes in progress bar
bar.SetTotal(event.Total)
// Set amount of bytes received in progress bar
bar.SetCurrent(event.Received)
// If transfer finished, break
if event.Received == event.Total {
break
}
}
// Finish progress bar
bar.Finish()