mirror of
https://github.com/CosmicStar98/bedrocktool.git
synced 2024-06-02 02:45:14 +00:00
updater logging
This commit is contained in:
parent
e797457150
commit
e46b2f104d
|
@ -22,9 +22,22 @@ func (c *UpdateCMD) Usage() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *UpdateCMD) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
|
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 {
|
if err := utils.Updater.Update(); err != nil {
|
||||||
logrus.Error(err)
|
logrus.Error(err)
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logrus.Infof("Updated!")
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user