Skip to content

Commit 038d466

Browse files
committed
Use new DrupalFinderComposerRuntime API
1 parent 554b39f commit 038d466

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

scripts/composer/ScriptHandler.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,26 @@
1111
use Composer\Semver\Comparator;
1212
use Drupal\Core\Site\Settings;
1313
use Drupal\Core\Site\SettingsEditor;
14-
use DrupalFinder\DrupalFinder;
14+
use DrupalFinder\DrupalFinderComposerRuntime;
1515
use Symfony\Component\Filesystem\Filesystem;
1616
use Symfony\Component\Filesystem\Path;
1717

1818
class ScriptHandler {
1919

2020
public static function createRequiredFiles(Event $event) {
2121
$fs = new Filesystem();
22-
$drupalFinder = new DrupalFinder();
23-
$drupalFinder->locateRoot(getcwd());
22+
$drupalFinder = new DrupalFinderComposerRuntime();
2423
$drupalRoot = $drupalFinder->getDrupalRoot();
2524

25+
// If Drupal root was not found, exit.
26+
if (is_null($drupalRoot)) {
27+
$io = $event->getIO();
28+
$io->writeError(
29+
'<error>Drupal root could not be detected.</error>',
30+
);
31+
exit(1);
32+
}
33+
2634
$dirs = [
2735
'modules',
2836
'profiles',

0 commit comments

Comments
 (0)