Skip to content

Commit

Permalink
handle update error
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfa committed Sep 20, 2022
1 parent c3b783a commit d4740ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ func updateCmd() *cobra.Command {
reader, err := os.Open(filepath.Join(os.TempDir(), cliName))
utl.CheckErr(err)
err = update.Apply(reader, update.Options{})
if err != nil {
update.RollbackError(err)
fmt.Println(err)
utl.CheckErr(fmt.Errorf("update failed :("))
}
fmt.Println("update finished successfully :)")
},
}
Expand Down

0 comments on commit d4740ce

Please sign in to comment.