facebook / watchman

Watches files and records, or triggers actions, when they change.
https://facebook.github.io/watchman/
MIT License
12.8k stars 995 forks source link

Customise launchd plist location on macOS #929

Open carlocab opened 3 years ago

carlocab commented 3 years ago

Currently, the plist location appears to be hard-coded in

https://github.com/facebook/watchman/blob/34ac399bbcc8841692e9d7d7c8807efc772a5100/watchman/main.cpp#L431-L440

Is it possible to allow this location to be specified, perhaps as a command-line option?

One use-case for this is to allow proper testing in Homebrew. Currently, our test is limited to checking the output of watchman -v, because our testing sandbox limits the locations you can write to, and this does not include ~/Library/LaunchAgents. However, since we build watchman against Homebrew-provided dependencies it would be good to have a proper test of functionality here.

martin-braun commented 2 years ago

Can I learn about the reason why it needs to have a LaunchAgent anyways? As far as I can inspect it, it runs only interactively, so there is no need for the LaunchAgent in the first place, right?