Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 78ed8cc

Browse files
committedJul 9, 2024·
Check that the new executable exists and is in the right path before proceding with the update
1 parent 38e50a9 commit 78ed8cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎updater/updater_darwin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func checkForUpdates(currentVersion string, updateURL string, cmdName string) (s
143143

144144
// Install new app
145145
logrus.WithField("from", tmpAppPath).WithField("to", currentAppPath).Info("Copying updated app")
146-
if err := tmpAppPath.CopyDirTo(currentAppPath); err != nil {
146+
if err := tmpAppPath.CopyDirTo(currentAppPath); err != nil || !paths.New(executablePath).Exist() {
147147
// Try rollback changes
148148
_ = currentAppPath.RemoveAll()
149149
_ = oldAppPath.Rename(currentAppPath)

0 commit comments

Comments
 (0)
Please sign in to comment.