func (u *Updater) promptForUpdateAction(ui libkb.UpdateUI, update keybase1.Update) (err error) { u.log.Debug("+ Updater.promptForUpdateAction") defer func() { u.log.Debug("- Updater.promptForUpdateAction -> %v", err) }() if auto := u.config.GetUpdatePreferenceAuto(); auto { u.log.Debug("| going ahead with auto-updates") return } if ui == nil { err = libkb.NoUIError{Which: "Update"} return } updatePromptResponse, err := ui.UpdatePrompt(context.TODO(), keybase1.UpdatePromptArg{Update: update}) if err != nil { return } u.log.Debug("Update prompt respose: %#v", updatePromptResponse) if updatePromptResponse.AlwaysAutoInstall { u.config.SetUpdatePreferenceAuto(true) } switch updatePromptResponse.Action { case keybase1.UpdateAction_UPDATE: case keybase1.UpdateAction_SKIP: err = libkb.CanceledError{M: "skipped update"} u.config.SetUpdatePreferenceSkip(update.Version) case keybase1.UpdateAction_SNOOZE: err = libkb.CanceledError{M: "snoozed update"} u.config.SetUpdatePreferenceSnoozeUntil(updatePromptResponse.SnoozeUntil) case keybase1.UpdateAction_CANCEL: err = libkb.CanceledError{M: "canceled update"} default: err = libkb.CanceledError{M: "unexpected cancelation"} } return }