File tree 1 file changed +11
-3
lines changed 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 11
11
use Composer \Semver \Comparator ;
12
12
use Drupal \Core \Site \Settings ;
13
13
use Drupal \Core \Site \SettingsEditor ;
14
- use DrupalFinder \DrupalFinder ;
14
+ use DrupalFinder \DrupalFinderComposerRuntime ;
15
15
use Symfony \Component \Filesystem \Filesystem ;
16
16
use Symfony \Component \Filesystem \Path ;
17
17
18
18
class ScriptHandler {
19
19
20
20
public static function createRequiredFiles (Event $ event ) {
21
21
$ fs = new Filesystem ();
22
- $ drupalFinder = new DrupalFinder ();
23
- $ drupalFinder ->locateRoot (getcwd ());
22
+ $ drupalFinder = new DrupalFinderComposerRuntime ();
24
23
$ drupalRoot = $ drupalFinder ->getDrupalRoot ();
25
24
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
+
26
34
$ dirs = [
27
35
'modules ' ,
28
36
'profiles ' ,
You can’t perform that action at this time.
0 commit comments