-
Notifications
You must be signed in to change notification settings - Fork 27
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
Use realpath() to find the parent of a relative path #40
base: master
Are you sure you want to change the base?
Conversation
b8a0577
to
8ab71b1
Compare
Rebasing/updating to add a failing test, and then the fix |
0ecad73
to
4258bf4
Compare
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.
FWIW I’ve had problems in the past when using real path on windows. Not sure if that applies here. Would be ideal to find a different approach.
If Windows only needs to make the path real "enough" to find the parent directory each time, if any, and this method is called until there is no parent directory, so the bug mentioned here does not apply.
|
Changes approved. I'd still find this really useful. @webflo would you mind reviewing? |
Any thoughts @webflo? |
I noticed Drush 9 would find my Drupal site with any of these:
$ cd site $ drush -r ../site/web status $ drush -r /Users/patrick/site/web status $ drush -r web/../web status
but curiously not with:
$ cd site $ drush -r web status
My
composer.json
lives insite
, while autoload.php and core live underweb
, based on https://github.com/platformsh/template-drupal8I noticed the
shiftPathUp()
method does not account for relative paths.This PR is a small modification to
shiftPathUp()
which means it can use therealpath()
if necessary to normalize a relative path.If incorporated into Drush 9, this would allow a Platform.sh CLI issue to be resolved quite nicely platformsh/legacy-cli#772