Skip to content

Commit

Permalink
macOS: create LaunchAgents folder if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
creativeprojects committed Feb 6, 2024
1 parent 1317f60 commit 99484bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions schedule/handler_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ func (h *HandlerLaunchd) createPlistFile(launchdJob *LaunchdJob, permission stri
if err != nil {
return "", err
}
if permission != constants.SchedulePermissionSystem {
// in some very recent installations of macOS, the user's LaunchAgents folder may not exist
_ = h.fs.MkdirAll(path.Dir(filename), 0o700)
}
file, err := h.fs.Create(filename)
if err != nil {
return "", err
Expand Down

0 comments on commit 99484bf

Please sign in to comment.