Skip to content

Commit fc49266

Browse files
committed
if the running binary is the old running one we don't do anything
otherwise we break the agent after the auto-update
1 parent 8bf558d commit fc49266

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

main.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,15 @@ func loop() {
444444
}()
445445
}
446446

447-
// oldInstallExixts will return true if an old installation of the agent exixts (on macos)
447+
// oldInstallExists will return true if an old installation of the agent exists (on macos) and is not the process running
448448
func oldInstallExists() bool {
449449
oldAgentPath := config.GetDefaultHomeDir().Join("Applications", "ArduinoCreateAgent")
450+
currentBinary, _ := os.Executable()
451+
// if the current running binary is the old one we don't need to do anything
452+
binIsOld, _ := paths.New(currentBinary).IsInsideDir(oldAgentPath)
453+
if binIsOld {
454+
return false
455+
}
450456
return oldAgentPath.Exist()
451457
}
452458

0 commit comments

Comments
 (0)