Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion config/autostart.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ var launchdAgentDefinition []byte

// getLaunchdAgentPath will return the path of the launchd agent default path
func getLaunchdAgentPath() *paths.Path {
return GetDefaultHomeDir().Join("Library", "LaunchAgents", "ArduinoCreateAgent.plist")
homeDir := GetDefaultHomeDir()
launchAgentsPath := homeDir.Join("Library", "LaunchAgents")
agentPlistPath := launchAgentsPath.Join("ArduinoCreateAgent.plist")

if err := os.MkdirAll(launchAgentsPath.String(), 0755); err != nil {
log.Panicf("Could not create ~/Library/LaunchAgents directory: %s", err)
}

return agentPlistPath
}

// InstallPlistFile will handle the process of creating the plist file required for the autostart
Expand Down