Skip to content

Commit a6d675d

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

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
],
113113
"post-create-project-cmd": [
114114
"robo init:git --ansi",
115+
"DrupalProject\\composer\\ScriptHandler::createRequiredFiles",
115116
"DrupalProject\\composer\\ScriptHandler::createLocalSettingsFile"
116117
],
117118
"drupal-scaffold": [

scripts/composer/ScriptHandler.php

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

@@ -47,20 +46,20 @@ public static function createRequiredFiles(Event $event) {
4746
// Prepare the settings file for installation.
4847
if (!$fs->exists($drupalRoot . '/sites/default/settings.php') && $fs->exists($drupalRoot . '/sites/default/default.settings.php')) {
4948
$fs->copy($drupalRoot . '/sites/default/default.settings.php', $drupalRoot . '/sites/default/settings.php');
50-
}
51-
else {
5249
require_once $drupalRoot . '/core/includes/bootstrap.inc';
5350
require_once $drupalRoot . '/core/includes/install.inc';
5451
new Settings([]);
55-
$config_path = Path::makeRelative($drupalFinder->getComposerRoot() . Robo::config()->get('drupal.config.path'), $drupalRoot);
5652
$settings['settings']['config_sync_directory'] = (object) [
57-
'value' => $config_path,
53+
'value' => Path::makeRelative($drupalFinder->getComposerRoot() . '/config/sync', $drupalRoot),
5854
'required' => TRUE,
5955
];
6056
drupal_rewrite_settings($settings, $drupalRoot . '/sites/default/settings.php');
6157
$fs->chmod($drupalRoot . '/sites/default/settings.php', 0666);
6258
$event->getIO()->write("Created a sites/default/settings.php file with chmod 0666");
6359
}
60+
else {
61+
$event->getIO()->write("<info>All required files are created. Good to go!!!...</info>");
62+
}
6463

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

0 commit comments

Comments
 (0)