|
7 | 7 | use Composer\Script\Event; |
8 | 8 | use Drupal\Core\Site\Settings; |
9 | 9 | use DrupalFinder\DrupalFinder; |
| 10 | +use Robo\Robo; |
10 | 11 | use Symfony\Component\Filesystem\Filesystem; |
11 | 12 | use Webmozart\PathUtil\Path; |
12 | 13 |
|
@@ -46,20 +47,20 @@ public static function createRequiredFiles(Event $event) { |
46 | 47 | // Prepare the settings file for installation. |
47 | 48 | if (!$fs->exists($drupalRoot . '/sites/default/settings.php') && $fs->exists($drupalRoot . '/sites/default/default.settings.php')) { |
48 | 49 | $fs->copy($drupalRoot . '/sites/default/default.settings.php', $drupalRoot . '/sites/default/settings.php'); |
| 50 | + } |
| 51 | + else { |
49 | 52 | require_once $drupalRoot . '/core/includes/bootstrap.inc'; |
50 | 53 | require_once $drupalRoot . '/core/includes/install.inc'; |
51 | 54 | new Settings([]); |
| 55 | + $config_path = Path::makeRelative($drupalFinder->getComposerRoot() . Robo::config()->get('drupal.config.path'), $drupalRoot); |
52 | 56 | $settings['settings']['config_sync_directory'] = (object) [ |
53 | | - 'value' => Path::makeRelative($drupalFinder->getComposerRoot() . '/config/sync', $drupalRoot), |
| 57 | + 'value' => $config_path, |
54 | 58 | 'required' => TRUE, |
55 | 59 | ]; |
56 | 60 | drupal_rewrite_settings($settings, $drupalRoot . '/sites/default/settings.php'); |
57 | 61 | $fs->chmod($drupalRoot . '/sites/default/settings.php', 0666); |
58 | 62 | $event->getIO()->write("Created a sites/default/settings.php file with chmod 0666"); |
59 | 63 | } |
60 | | - else { |
61 | | - $event->getIO()->write("<info>All required files are created. Good to go!!!...</info>"); |
62 | | - } |
63 | 64 |
|
64 | 65 | // Create the files directory with chmod 0777. |
65 | 66 | if (!$fs->exists($drupalRoot . '/sites/default/files')) { |
|
0 commit comments