Skip to content

Commit

Permalink
Check that the new executable exists and is in the right path before …
Browse files Browse the repository at this point in the history
…proceding with the update
  • Loading branch information
MatteoPologruto committed Jul 9, 2024
1 parent 38e50a9 commit 78ed8cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion updater/updater_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func checkForUpdates(currentVersion string, updateURL string, cmdName string) (s

// Install new app
logrus.WithField("from", tmpAppPath).WithField("to", currentAppPath).Info("Copying updated app")
if err := tmpAppPath.CopyDirTo(currentAppPath); err != nil {
if err := tmpAppPath.CopyDirTo(currentAppPath); err != nil || !paths.New(executablePath).Exist() {
// Try rollback changes
_ = currentAppPath.RemoveAll()
_ = oldAppPath.Rename(currentAppPath)
Expand Down

0 comments on commit 78ed8cc

Please sign in to comment.