personalnadir Posted June 27, 2022 Posted June 27, 2022 As Alfred scripts do not see custom PATHs and MacPorts uses /opt/local/bin as it's install location, I was wondering what the accepted solution was to making sure that Workflows support MacPort installs?
vitor Posted June 27, 2022 Posted June 27, 2022 You extend the PATH yourself in your script. In bash/zsh it means adding a line at the top: export PATH="/opt/local/bin:${PATH}".
personalnadir Posted June 28, 2022 Author Posted June 28, 2022 Thanks, I figured that would be the case. Was wondering if there was a global way to set it for all workflows?
vitor Posted June 28, 2022 Posted June 28, 2022 There is not, by design. A predictable environment helps when sharing Workflows or using them on a different Mac. It also reduces the chance of an external Workflow breaking due to a local change.
dale Posted October 9, 2023 Posted October 9, 2023 On 6/28/2022 at 6:27 AM, vitor said: There is not, by design. A predictable environment helps when sharing Workflows or using them on a different Mac. It also reduces the chance of an external Workflow breaking due to a local change. A predictable path makes sense, but you've given Homebrew endorsement with no way for users to opt in to another package manager. MacPorts is still relatively popular, as far as I know. Am I to understand the way forward is to have every individual Workflow author opt in to supporting MacPorts in /opt/local? Right now I'm looking at having to manually edit the scripts in some workflows I've gotten from the gallery. I don't yet know how that could affect gallery auto-updates. PS: I'll take this opportunity to thank you for your wide-ranging efforts, Vitor. I've noticed you popping up all over on GitHub when it comes to Alfred, and I appreciate your work to help people make their workflows great. :)
vitor Posted October 9, 2023 Posted October 9, 2023 Homebrew is the de facto macOS package manager. Even Apple uses it and has formulae for it and worked with the Homebrew team during the Apple Silicon transition. Even ignoring that, there are several reasons which make Homebrew the best choice. It is also quite self-contained, there is no problem with having it installed in parallel. You can just leave it be and not use it in your own PATH in a Terminal. Or you can symlink your Macports binaries to the Homebrew install locations. Changing the PATH in workflow scripts has zero effect on them being updated from the Gallery. But you’ll lose your changes when you do, same as if you updated manually. 5 hours ago, dale said: PS: I'll take this opportunity to thank you for your wide-ranging efforts, Vitor. I've noticed you popping up all over on GitHub when it comes to Alfred, and I appreciate your work to help people make their workflows great. Thank you for the kind words.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now