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
Update command doesn't escape php_binary path, update fails when path has spaces #5815
Comments
Thanks for the report, @adamperrry ! It'd probably be better to switch the entire thing to Lines 269 to 283 in 90be24d
Feel free to submit a pull request, if you'd like. Here is some guidance on our pull request best practices. We have some existing tests in the bundle, so I don't think you need to add new tests for this scenario: |
@adamperrry Looks like there's some problem with I'm going to revert your PR for now. We could probably add a feature test to this repo so we have easier access to the failure. |
It looks like the logs for the Github action have expired and are no longer accessible: https://github.com/wp-cli/wp-cli-bundle/actions/runs/5744386636/job/15570571355?pr=563 @danielbachhuber do you know what the issue is? I'm still wrapping my head around how all these repos fit, but it looks like the wp-cli-bundle is mainly in charge of combining the various commands into the actual shippable Trying to get that error, I:
It looks like the one new error is:
Does any of that look like it has an obvious quick-fix? When you say:
Can you elaborate on that a bit? That would be another test here in |
@bgturner I don't recall, no 😔 If you want to re-create the original PR, we can spin up a wp-cli/wp-cli-bundle PR that uses the branch and see how the tests fail again. Or you can add the same feature test to this repo and we can see the error directly on the PR. Given this is such a critical code path though, we should probably even have unit tests around this particular logic.
Correct (and performing a final set of tests). |
@danielbachhuber -- was able to put in a little bit of time today and learned a bit more about Behat. I think I'm creating the bones of tests for but I'm curious to see what errors show because I was definitely getting errors locally. |
Bug Report
--- ✅ If you are in the correct location now... --->
Describe the current, buggy behavior
On macOS, at least, the
wp cli update
command fails when the path to the PHP binary running wp-cli (i.e. the value ofPHP_BINARY
when running the phar - seeUtils\get_php_binary()
) has a space in it. For our app, we give the option to download different versions of PHP, and we store those binaries in theApplication Support
folder. When a user is running wp-cli using any of those downloaded versions, the update will fail. However, it doesn't fail when they run the update command from our bundled version of PHP, which lives at a location without spaces in the path.Describe how other contributors can replicate this bug
$PATH
and run an older version of wp-cli with itwp cli update
and watch the command fail, saying the location doesn't exist, with the path given ending at the space.Describe what you expect as the correct outcome
I expect the
wp cli update
command to succeed regardless of where the PHP binaries being used live.Let us know what environment you are running this on
Provide a possible solution
In
CLI_Command.php > CLI_Command > update
, change:to
DIFF:
Provide additional context/screenshots
The text was updated successfully, but these errors were encountered: