Skip to content

Commit

Permalink
Use new Drupal Finder API. (drupal-composer#673)
Browse files Browse the repository at this point in the history
  • Loading branch information
tannguyen04 authored and szeidler committed Jul 2, 2024
1 parent 486253a commit 4d5bb57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 3 additions & 4 deletions scripts/composer/ScriptHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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);
Expand Down

0 comments on commit 4d5bb57

Please sign in to comment.