Skip to content

Prevent crash by ensuring LaunchAgents dir is created#18

Merged
brasic merged 1 commit intoBlakeWilliams:mainfrom
brasic:launchd-mkdir
Mar 17, 2023
Merged

Prevent crash by ensuring LaunchAgents dir is created#18
brasic merged 1 commit intoBlakeWilliams:mainfrom
brasic:launchd-mkdir

Conversation

@brasic
Copy link
Collaborator

@brasic brasic commented Mar 16, 2023

I tried to use the launchd feature added in #16 on a new laptop but it didn't work:

$ rdm service
Manage this program as a launchd system service.
  Status of gui/502/me.blakewilliams.rdm:
    Install state: [Unknown] (Unexpected missing directory /Users/cbrasic/Library/LaunchAgents (stat /Users/cbrasic/Library/LaunchAgents: no such file or directory))
    Run state:     [NoSuchService]

Usage:
  rdm service [command]

Available Commands:
  install     Configures rdm to run on boot as a MacOS LaunchAgent.
  start       Starts the launchd service.
  stop        Stops the launchd service.
  uninstall   Removes a previously installed LaunchAgent installation.

Flags:
  -h, --help   help for service

Use "rdm service [command] --help" for more information about a command.
$ rdm service install
Problem installing: could not find definition path: Unexpected missing directory /Users/cbrasic/Library/LaunchAgents (stat /Users/cbrasic/Library/LaunchAgents: no such file or directory)

I neglected to always ensure the user LaunchAgents directory at ~/LaunchAgents is present. That's fixed in brasic/launchd#2 which this PR pulls in.

@brasic brasic merged commit c7b156a into BlakeWilliams:main Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants