-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix php for macOS Monterey #158
Conversation
This can be condensed to if [ -x "/opt/homebrew/bin/php" ]; then
PHP_BIN=/opt/homebrew/bin/php
elif [ -x "/usr/local/bin/php" ]; then
PHP_BIN=/usr/local/bin/php
elif [ -x "/usr/bin/php" ]; then
PHP_BIN=/usr/bin/php
fi
$PHP_BIN ./bin/index.php bower {query} Also, switch from |
@jeffbyrnes I get this error with your code suggestion: |
Trust me to typo this 🤦🏻♂️ Edited the original to be correct. |
Or… not… might have (re)learned a bash nuance… |
Right… spaces are meaningful when assigning variables. Derp! All fixed & really works now, sorry about that. |
That said, I think Alfred is now, as of the most recent version, set to do this internally if you use a relative |
@jeffbyrnes would be a bad idea to do it maybe simpler: I am using now Alfred 4.6.1 and was not working for me 🤷♂️ |
Well now that’s an idea! Though it does leave it up to the end-user to know where their copy of PHP, if any, is installed. |
yes, that is true. But this is a workflow for developers, so this should not be a big issue. Just open a terminal and write |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works fine on Monterey.
Can also update the PATH variable in environment variable & you won't have to change any of the other values.
|
@jeffbyrnes When this will come up to the master? |
@learn2reid Could give us more explanation about where do we set PATH env vars? In each script invocation in the workflow? |
@varp I haven’t had much time to devote to this lately, but I’ll see what I can do this week. As for @learn2reid’s suggestion, if the workflow is using the unqualified I’ll try that, first, before we go adding complications, and thus fragility, to the workflow. |
Ok, a quick test: it seems that Alfred runs scripts & don’t inherit |
@jeffbyrnes Firstly , thank you! |
@varp yes, I agree. The solution from @jeffbyrnes is better. Feel free to close this PR. |
Alright! Glad that works well folks. |
@jeffbyrnes I've just tested your suggested solution with path |
@jeffbyrnes glad it worked for others too. @varp Yes, if you refer back to my original comment with my solution, I did not add $PATH to the variable. I just added the PATH from login invocation.
|
Checks for PHP location to handle differences between Intel/M1 macs running Monterey.
Instead of running things like this:
we now do:
Not sure if this is the best way but fixes the problem.
/issues/157
UPDATE
After @jeffbyrnes comments I decide to do it simpler, now all php calls use env
$PHP_BIN
, each user can set it as needed. I test it locally and works great.$PHP_BIN ./bin/index.php bower {query}