Skip to content

Commit

Permalink
Use new DrupalFinderComposerRuntime API
Browse files Browse the repository at this point in the history
  • Loading branch information
jnoordsij authored May 13, 2024
1 parent f14853c commit 8428fa3
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions scripts/composer/ScriptHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,26 @@
use Composer\Semver\Comparator;
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();

// If Drupal root was not found, exit.
if (is_null($drupalRoot)) {
$io = $event->getIO();
$io->writeError(
'<error>Drupal root could not be detected.</error>',
);
exit(1);
}

$dirs = [
'modules',
'profiles',
Expand Down

0 comments on commit 8428fa3

Please sign in to comment.