Skip to content

Commit 24868ac

Browse files
committed
Setup config path in settings file.
1 parent 112ace1 commit 24868ac

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/composer/ScriptHandler.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Composer\Script\Event;
88
use Drupal\Core\Site\Settings;
99
use DrupalFinder\DrupalFinder;
10+
use Robo\Robo;
1011
use Symfony\Component\Filesystem\Filesystem;
1112
use Webmozart\PathUtil\Path;
1213

@@ -46,20 +47,20 @@ public static function createRequiredFiles(Event $event) {
4647
// Prepare the settings file for installation.
4748
if (!$fs->exists($drupalRoot . '/sites/default/settings.php') && $fs->exists($drupalRoot . '/sites/default/default.settings.php')) {
4849
$fs->copy($drupalRoot . '/sites/default/default.settings.php', $drupalRoot . '/sites/default/settings.php');
50+
}
51+
else {
4952
require_once $drupalRoot . '/core/includes/bootstrap.inc';
5053
require_once $drupalRoot . '/core/includes/install.inc';
5154
new Settings([]);
55+
$config_path = Path::makeRelative($drupalFinder->getComposerRoot() . Robo::config()->get('drupal.config.path'), $drupalRoot);
5256
$settings['settings']['config_sync_directory'] = (object) [
53-
'value' => Path::makeRelative($drupalFinder->getComposerRoot() . '/config/sync', $drupalRoot),
57+
'value' => $config_path,
5458
'required' => TRUE,
5559
];
5660
drupal_rewrite_settings($settings, $drupalRoot . '/sites/default/settings.php');
5761
$fs->chmod($drupalRoot . '/sites/default/settings.php', 0666);
5862
$event->getIO()->write("Created a sites/default/settings.php file with chmod 0666");
5963
}
60-
else {
61-
$event->getIO()->write("<info>All required files are created. Good to go!!!...</info>");
62-
}
6364

6465
// Create the files directory with chmod 0777.
6566
if (!$fs->exists($drupalRoot . '/sites/default/files')) {

0 commit comments

Comments
 (0)