Skip to content
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

When drush is in a vendor dir, try to automatically find root. #3101

Merged
merged 2 commits into from
Oct 25, 2017
Merged

Conversation

weitzman
Copy link
Member

No description provided.

// Try two approaches.
if (!$selectedRoot = $this->preflightArgs->selectedSite(DRUSH_COMMAND)) {
$selectedRoot = $this->preflightArgs->selectedSite($this->environment->cwd());
}
return $this->setSelectedSite($selectedRoot, $this->environment->vendorPath());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$this->environment->vendorPath() is used later to fall back to finding the Drupal site from the vendor directory. If this isn't working correctly in the SUT (e.g. due to symlinking), then perhaps change this expression to something else. For example, maybe:

$selectedRoot = $this->preflightArgs->selectedSite($this->environment->cwd());
$fallbackPath = $this->preflightArgs->selectedSite(DRUSH_COMMAND);
return $this->setSelectedSite($selectedRoot, $fallbackPath)

I haven't tried this, but that's how setSelectedSite() is supposed to work, anyway. "Selected root" is the root the user selected via cwd et. al., and the fallback path is information used to find the site from other information e.g. vendor path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants