Skip to content

Commit

Permalink
Use web-root specified for the core's scaffold plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
hussainweb committed Feb 11, 2020
1 parent 123e248 commit 6789cb6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/DrupalFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ protected function isValidRoot($path)
}

if (is_array($json)) {
if (isset($json['extra']['installer-paths']) && is_array($json['extra']['installer-paths'])) {
if (!empty($json['extra']['drupal-scaffold']['locations']['web-root'])) {
$web_prefix = rtrim($json['extra']['drupal-scaffold']['locations']['web-root'], '/');
$this->composerRoot = $path;
$this->drupalRoot = $path . '/' . $web_prefix;
$this->vendorDir = $path . '/vendor';
} elseif (isset($json['extra']['installer-paths']) && is_array($json['extra']['installer-paths'])) {
foreach ($json['extra']['installer-paths'] as $install_path => $items) {
if (in_array('type:drupal-core', $items) ||
in_array('drupal/core', $items) ||
Expand Down

0 comments on commit 6789cb6

Please sign in to comment.