mainUpdate: refactor to handle quiet flag properly (#3744)

This commit is contained in:
Bala FA
2017-02-15 14:01:00 +05:30
committed by Harshavardhana
parent c6e76160ad
commit 602dac8773
6 changed files with 479 additions and 438 deletions

View File

@@ -145,14 +145,13 @@ func checkMainSyntax(c *cli.Context) {
func checkUpdate() {
// Do not print update messages, if quiet flag is set.
if !globalQuiet {
updateMsg, _, err := getReleaseUpdate(minioUpdateStableURL, 1*time.Second)
older, downloadURL, err := getUpdateInfo(1 * time.Second)
if err != nil {
// Ignore any errors during getReleaseUpdate(), possibly
// because of network errors.
// Its OK to ignore any errors during getUpdateInfo() here.
return
}
if updateMsg.Update {
console.Println(updateMsg)
if older > time.Duration(0) {
console.Println(colorizeUpdateMessage(downloadURL, older))
}
}
}