Skip to content

Commit e82db34

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 9b78c5c commit e82db34

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,14 @@ 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+
if paths.New(currentBinary).IsInsideDir(oldAgentPath) {
453+
return false
454+
}
450455
return oldAgentPath.Exist()
451456
}
452457

0 commit comments

Comments
 (0)