updater logging

This commit is contained in:
olebeck 2022-09-06 09:48:52 +02:00
parent e797457150
commit e46b2f104d
1 changed files with 13 additions and 0 deletions

View File

@ -22,9 +22,22 @@ func (c *UpdateCMD) Usage() string {
}
func (c *UpdateCMD) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
newVersion, err := utils.Updater.UpdateAvailable()
if err != nil {
logrus.Error(err)
return 1
}
if newVersion == "" {
logrus.Info("No Updates available.")
}
logrus.Infof("Updating to %s", newVersion)
if err := utils.Updater.Update(); err != nil {
logrus.Error(err)
return 1
}
logrus.Infof("Updated!")
return 0
}