Create LaunchAgents/
directory if it doesn't exist (MacOS)
#811
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
config
at this time felt a bit out of scope imo) Happy to add them in another place though!In the meantime, here's a quick Gist you can run to test out the changes locally: https://gist.github.com/xplato/ff85973647e9a1b5190361e331c27fe0
This is a bug fix in the
config
module. On MacOS, sometimes the~/Library/LaunchAgents/
directory does not exist—if not, this would cause the program to not start because the path to the config file would be invalid (see the end of this PR description for the relevant log/info). This will create the directory if it doesn't exist, allowing the program to run correctly.If the
~/Library/LaunchAgents
directory doesn't exist, the program will not start.Updates the
getLaunchdAgentPath
function to create the~/Library/LaunchAgents
directory if it doesn't exist, returning the path as usual.No (depends on how you look at it I guess 😅).
The only way I found to catch this is by deleting the
~/Library/LaunchAgents
directory and running the binary manually viaArduinoCreateAgent.app
-> "Show package contents" ->Contents/MacOS/Arduino_Create_Agent
The relevant log:
ERRO[0000] open /Users/$USER/Library/LaunchAgents/ArduinoCreateAgent.plist: no such file or directory