Skip to content

Commit

Permalink
if the running binary is the old running one we don't do anything
Browse files Browse the repository at this point in the history
otherwise we break the agent after the auto-update
  • Loading branch information
umbynos committed May 18, 2023
1 parent 9b78c5c commit e82db34
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,14 @@ func loop() {
}()
}

// oldInstallExixts will return true if an old installation of the agent exixts (on macos)
// oldInstallExists will return true if an old installation of the agent exists (on macos) and is not the process running
func oldInstallExists() bool {
oldAgentPath := config.GetDefaultHomeDir().Join("Applications", "ArduinoCreateAgent")
currentBinary, _ := os.Executable()
// if the current running binary is the old one we don't need to do anything
if paths.New(currentBinary).IsInsideDir(oldAgentPath) {
return false
}
return oldAgentPath.Exist()
}

Expand Down

0 comments on commit e82db34

Please sign in to comment.