fix update check logic
parent
1d80003313
commit
1ba9792419
|
@ -148,11 +148,8 @@ func runStart(cmd *cobra.Command, args []string) {
|
|||
displayVersion(version.GetVersion())
|
||||
go download.CleanUpOlderPreloads()
|
||||
|
||||
// No need to do the update check if no one is going to see it
|
||||
if !viper.GetBool(interactive) || !viper.GetBool(dryRun) {
|
||||
// Avoid blocking execution on optional HTTP fetches
|
||||
go notify.MaybePrintUpdateTextFromGithub()
|
||||
}
|
||||
// Avoid blocking execution on optional HTTP fetches
|
||||
go notify.MaybePrintUpdateTextFromGithub()
|
||||
|
||||
displayEnviron(os.Environ())
|
||||
if viper.GetBool(force) {
|
||||
|
|
|
@ -119,6 +119,12 @@ func shouldCheckURLVersion(filePath string) bool {
|
|||
if !viper.GetBool(config.WantUpdateNotification) {
|
||||
return false
|
||||
}
|
||||
if !viper.GetBool("interactive") {
|
||||
return false
|
||||
}
|
||||
if viper.GetBool("dry-run") {
|
||||
return false
|
||||
}
|
||||
lastUpdateTime := timeFromFileIfExists(filePath)
|
||||
return time.Since(lastUpdateTime).Hours() >= viper.GetFloat64(config.ReminderWaitPeriodInHours)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue