diff --git a/composer.json b/composer.json index 074e0b476..4b3025108 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "oomphinc/composer-installers-extender": "^2.0", "ramsalt/drupal-scaffold": "*", "vlucas/phpdotenv": "^5.1", - "webflo/drupal-finder": "^1.2" + "webflo/drupal-finder": "^1.3" }, "require-dev": { "drupal/core-dev": "^10.2.0" diff --git a/scripts/composer/ScriptHandler.php b/scripts/composer/ScriptHandler.php index 244178817..3d3ba626f 100644 --- a/scripts/composer/ScriptHandler.php +++ b/scripts/composer/ScriptHandler.php @@ -12,15 +12,14 @@ use Drupal\Core\Site\Settings; use Drupal\Core\Site\SettingsEditor; use DrupalFinder\DrupalFinder; +use DrupalFinder\DrupalFinderComposerRuntime; use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\Filesystem\Path; class ScriptHandler { public static function createRequiredFiles(Event $event) { $fs = new Filesystem(); - $drupalFinder = new DrupalFinder(); - $drupalFinder->locateRoot(getcwd()); + $drupalFinder = new DrupalFinderComposerRuntime(); $drupalRoot = $drupalFinder->getDrupalRoot(); $dirs = [ @@ -44,7 +43,7 @@ public static function createRequiredFiles(Event $event) { require_once $drupalRoot . '/core/includes/install.inc'; new Settings([]); $settings['settings']['config_sync_directory'] = (object) [ - 'value' => Path::makeRelative($drupalFinder->getComposerRoot() . '/config/sync', $drupalRoot), + 'value' => '../config/sync', 'required' => TRUE, ]; SettingsEditor::rewrite($drupalRoot . '/sites/default/settings.php', $settings);