File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
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 ;
15
14
use DrupalFinder \DrupalFinderComposerRuntime ;
16
15
use Symfony \Component \Filesystem \Filesystem ;
16
+ use Symfony \Component \Filesystem \Path ;
17
17
18
18
class ScriptHandler {
19
19
@@ -22,6 +22,11 @@ public static function createRequiredFiles(Event $event) {
22
22
$ drupalFinder = new DrupalFinderComposerRuntime ();
23
23
$ drupalRoot = $ drupalFinder ->getDrupalRoot ();
24
24
25
+ if (is_null ($ drupalRoot )) {
26
+ $ event ->getIO ()->writeError ('<error>Drupal root could not be detected.</error> ' );
27
+ exit (1 );
28
+ }
29
+
25
30
$ dirs = [
26
31
'modules ' ,
27
32
'profiles ' ,
@@ -43,7 +48,7 @@ public static function createRequiredFiles(Event $event) {
43
48
require_once $ drupalRoot . '/core/includes/install.inc ' ;
44
49
new Settings ([]);
45
50
$ settings ['settings ' ]['config_sync_directory ' ] = (object ) [
46
- 'value ' => ' .. /config/sync ' ,
51
+ 'value ' => Path:: makeRelative ( $ drupalFinder -> getComposerRoot () . ' /config/sync ', $ drupalRoot ) ,
47
52
'required ' => TRUE ,
48
53
];
49
54
SettingsEditor::rewrite ($ drupalRoot . '/sites/default/settings.php ' , $ settings );
You can’t perform that action at this time.
0 commit comments