Open andymckay opened 2 years ago
Thanks @andymckay - this is a great issue.
@leaanthony This seems like something we can address, what do you think it best practice here?
Have paths in config and add them to the env on startup.
In the end I found it pretty easy to drop in a bash file, that adds in /usr/local/bin
to the $PATH
and then that calls the JS file. That's worked so far for every way I've been able to launch xbar and for all the users of my plugins.
I've just posted a technique at https://github.com/matryer/xbar/issues/856#issuecomment-1445501343 that may also be useful to mitigate this issue from the plugin side without needing a plugin file to first run some shell commands and then call your actual executable.
Locally I've got 4 (there's probably more) ways of running xbar:
You might get a different path from doing those. I wrote a quick plugin like this to discover all the paths that you get.
And I can see that in some cases I'll get
/usr/bin/local
in there, depending upon how its run, sometimes I won't.This is a similar issue to:
Where people are finding that the PATH is different.
Would it make sense to try injecting
/usr/bin/local
into the environment? Or is there another way to avoid this problem? Currently I'm asking all the users ofxbar
to run it from the terminal.