File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1111use Composer \Semver \Comparator ;
1212use Drupal \Core \Site \Settings ;
1313use Drupal \Core \Site \SettingsEditor ;
14- use DrupalFinder \DrupalFinder ;
1514use DrupalFinder \DrupalFinderComposerRuntime ;
1615use Symfony \Component \Filesystem \Filesystem ;
16+ use Symfony \Component \Filesystem \Path ;
1717
1818class ScriptHandler {
1919
@@ -22,6 +22,11 @@ public static function createRequiredFiles(Event $event) {
2222 $ drupalFinder = new DrupalFinderComposerRuntime ();
2323 $ drupalRoot = $ drupalFinder ->getDrupalRoot ();
2424
25+ if (is_null ($ drupalRoot )) {
26+ $ event ->getIO ()->writeError ('<error>Drupal root could not be detected.</error> ' );
27+ exit (1 );
28+ }
29+
2530 $ dirs = [
2631 'modules ' ,
2732 'profiles ' ,
@@ -43,7 +48,7 @@ public static function createRequiredFiles(Event $event) {
4348 require_once $ drupalRoot . '/core/includes/install.inc ' ;
4449 new Settings ([]);
4550 $ settings ['settings ' ]['config_sync_directory ' ] = (object ) [
46- 'value ' => ' .. /config/sync ' ,
51+ 'value ' => Path:: makeRelative ( $ drupalFinder -> getComposerRoot () . ' /config/sync ', $ drupalRoot ) ,
4752 'required ' => TRUE ,
4853 ];
4954 SettingsEditor::rewrite ($ drupalRoot . '/sites/default/settings.php ' , $ settings );
You can’t perform that action at this time.
0 commit comments