Skip to content

Commit

Permalink
Uninstall automatically when failed updating
Browse files Browse the repository at this point in the history
  • Loading branch information
babarot committed Mar 11, 2022
1 parent adb5a3e commit 74cddca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ func (c *updateCmd) run(pkgs []config.Package) error {
switch err {
case nil:
c.state.Update(pkg)
default:
log.Printf("[DEBUG] uninstall %q because updating failed", pkg.GetName())
pkg.Uninstall(ctx)
}
select {
case results <- updateResult{Package: pkg, Error: err}:
Expand Down

0 comments on commit 74cddca

Please sign in to comment.