Mac PATH variable #2076
alienator88
started this conversation in
General
Replies: 1 comment
-
Nevermind, finally found this which resolved my issue: https://github.com/haroldadmin/pathfix |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
On mac when you launch a GUI app, it doesn't contain the usual shell environment variables, like PATH.
When trying to exec a command via wails without the absolute path, it obviously can't find the programs in the PATH to execute.
Anybody found a way to import all the PATH values from the various files/locations macos stores them in when launching the GUI standalone?
Launching via
wails dev
or executing the GUI application from terminal inherits the PATH values as expected.Coming from Electron, there is a package that fixes this for you: https://www.npmjs.com/package/fix-path
Maybe someone knows of a Go package that does the same? I couldn't find one.
I also tried to exec "/usr/libexec/path_helper" and pull the PATH out of there. This gives me
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
, but not everything like~/.zshrc
.For my use-case I need to run some binaries that users will have on their computer in their PATH. The location of these binaries can be anywhere the user installs them to so I can't hardcode the path unfortunately.
Beta Was this translation helpful? Give feedback.
All reactions