Skip to content

Commit d4740ce

Browse files
committed
handle update error
1 parent c3b783a commit d4740ce

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

pkg/cli/cli.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ func updateCmd() *cobra.Command {
110110
reader, err := os.Open(filepath.Join(os.TempDir(), cliName))
111111
utl.CheckErr(err)
112112
err = update.Apply(reader, update.Options{})
113+
if err != nil {
114+
update.RollbackError(err)
115+
fmt.Println(err)
116+
utl.CheckErr(fmt.Errorf("update failed :("))
117+
}
113118
fmt.Println("update finished successfully :)")
114119
},
115120
}

0 commit comments

Comments
 (0)