Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Chi-teck committed Apr 13, 2019
1 parent 34407bf commit 598b6c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/Command/Drupal_8/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ protected function interact(InputInterface $input, OutputInterface $output) {
$this->addFile('drush/sites/self.site.yml')
->template('d8/_project/drush/sites/self.site.yml.twig');
$this->addFile('scripts/sync-site.sh')
->template('d8/_project/scripts/sync-site.sh.twig');
->template('d8/_project/scripts/sync-site.sh.twig')
->mode(0544);
}

$this->addFile('patches/.keep')->content('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@
<?php

// -- settings.php file.
$default_settings_file = './docroot/sites/default/default.settings.php';
$settings_file = './docroot/sites/default/settings.php';
$default_settings_file = './{{ document_root_path }}sites/default/default.settings.php';
$settings_file = './{{ document_root_path }}sites/default/settings.php';

if (!file_exists($settings_file) && file_exists($default_settings_file)) {
$default_content = file_get_contents($default_settings_file);
$content = file_get_contents($default_settings_file);

{% if docrument_root %}
// Specify a directory for configuration data.
$current_code = '$config_directories = [];';
$new_code = <<<'EOS'
$config_directories = [
CONFIG_SYNC_DIRECTORY => DRUPAL_ROOT . '/../config/sync',
];
EOS;
$content = str_replace($current_code, $new_code, $default_content);
$content = str_replace($current_code, $new_code, $content);

{% endif %}
// Allow local development configuration.
$current_code = <<<'EOS'
#
Expand All @@ -34,16 +36,18 @@ EOS;

// -- settings.local.php file.
$example_local_settings_file = './{{ document_root_path }}sites/example.settings.local.php';
$local_settings_file = './docroot/sites/default/settings.local.php';
$local_settings_file = './{{ document_root_path }}sites/default/settings.local.php';
if (!file_exists($local_settings_file) && file_exists($example_local_settings_file)) {
if (!@copy($example_local_settings_file, $local_settings_file)) {
if (@copy($example_local_settings_file, $local_settings_file)) {
chmod($settings_file, 0666);
}
else {
file_put_contents('php://stderr', "Could not create $local_settings_file file.\n", FILE_APPEND);
}
chmod($settings_file, 0666);
}

// -- files directory.
$default_dir = './docroot/sites/default';
$default_dir = './{{ document_root_path }}sites/default';
$files_dir = $default_dir . '/files';
if (file_exists($default_dir) && !file_exists($files_dir)) {
$original_umask = umask(0);
Expand Down

0 comments on commit 598b6c5

Please sign in to comment.