Skip to content

Commit 19b4fc5

Browse files
Check that either the Create Agent or the Cloud Agent exist when autoupdating on macos
1 parent f953f9e commit 19b4fc5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

updater/updater_darwin.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ 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 || !paths.New(executablePath).Exist() {
146+
createPath := currentAppPath.Join("Contents", "MacOS", "Arduino_Create_Agent")
147+
cloudPath := currentAppPath.Join("Contents", "MacOS", "Arduino_Cloud_Agent")
148+
if err := tmpAppPath.CopyDirTo(currentAppPath); err != nil || (!createPath.Exist() && !cloudPath.Exist()) {
147149
// Try rollback changes
148150
_ = currentAppPath.RemoveAll()
149151
_ = oldAppPath.Rename(currentAppPath)

0 commit comments

Comments
 (0)