Use realpath() to find the parent of a relative path#40
Use realpath() to find the parent of a relative path#40pjcdawkins wants to merge 2 commits intowebflo:masterfrom
Conversation
b8a0577 to
8ab71b1
Compare
|
Rebasing/updating to add a failing test, and then the fix |
0ecad73 to
4258bf4
Compare
weitzman
left a comment
There was a problem hiding this comment.
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 statusbut curiously not with:
$ cd site $ drush -r web statusMy
composer.jsonlives 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