1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-19 09:52:03 +08:00

removed duplicate logic

This commit is contained in:
Henry
2014-10-20 19:01:50 +02:00
parent 46dc322f82
commit cb73ea7ba4
3 changed files with 20 additions and 23 deletions

View File

@ -24,17 +24,9 @@ func UpdateApply(n *core.IpfsNode, args []string, opts map[string]interface{}, o
}
fmt.Fprintln(out, "New Version:", u.Version)
if err = updates.AbleToApply(); err != nil {
return fmt.Errorf("Can't apply update: %v", err)
}
if err, errRecover := u.Update(); err != nil {
err = fmt.Errorf("Update failed: %v\n", err)
if errRecover != nil {
err = fmt.Errorf("%s\nRecovery failed! Cause: %v\nYou may need to recover manually", err, errRecover)
}
if err = updates.Apply(u); err != nil {
fmt.Fprint(out, err.Error())
return err
return fmt.Errorf("Couldn't apply update: %v", err)
}
fmt.Fprintln(out, "Updated applied! Shutting down.")