Skip to content

Commit

Permalink
Check that either the Create Agent or the Cloud Agent exist when auto…
Browse files Browse the repository at this point in the history
…updating on macos
  • Loading branch information
MatteoPologruto committed Jul 15, 2024
1 parent f953f9e commit 19b4fc5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion updater/updater_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ 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 || !paths.New(executablePath).Exist() {
createPath := currentAppPath.Join("Contents", "MacOS", "Arduino_Create_Agent")
cloudPath := currentAppPath.Join("Contents", "MacOS", "Arduino_Cloud_Agent")
if err := tmpAppPath.CopyDirTo(currentAppPath); err != nil || (!createPath.Exist() && !cloudPath.Exist()) {
// Try rollback changes
_ = currentAppPath.RemoveAll()
_ = oldAppPath.Rename(currentAppPath)
Expand Down

0 comments on commit 19b4fc5

Please sign in to comment.