Skip to content
Prev Previous commit
Next Next commit
Check that either the Create Agent or the Cloud Agent exist when auto…
…updating on macos
  • Loading branch information
MatteoPologruto committed Jul 17, 2024
commit eaeef3fc6bd2bde3881cbe7372f3d70cba8f4fa5
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