-1

To create a latest Drupal project with a local Drush I might do for example:

drt=/var/www/html
composer create-project drupal-composer/drupal-project "$drt"

To create a Drupal settings.php for such new Drupal project I assume I should do:

cp "$drt"/domain.tld/sites/default/default.settings.php \
"$drt"/domain.tld/sites/default/settings.php

Yet, I desire to make a version agnostic copy of the settings.php file that will be ready for other operations like sed or awk.

Is there some Drush/Drupal-console (or maybe even some Drupal-specified Composer option or argument - not sure about that) that will let me automize this operation in a version agnostic-way so that if "tomorrow" default.settings.php will have a different name or at least be located in another directory than ./sites/default/ I would still have a settings.php-like file without the need of a manual cp operation?

1

I wouldn’t have thought so. Copying a file is such a trivial act that I doubt anyone would’ve thought to wrap it up in a specific piece of functionality.

The only time the file would move would be as part of a major breaking update (e.g. moving from 8.x to 9.x), at which point you’ll want to be checking what’s changes anyway, and adjusting any scripts to conform to any new requirements.

Maybe a command would be written into Drush/console in the future if there were any plans to move or rename settings.php - currently there aren’t any such plans so it probably doesn’t make sense for one to exist.

  • It's good to know that generally it changes only in major upgrades. In second thought, and as you say, I'll have to know the architectural changes anyway (and change my Bash script accordingly). – JohnDoea Nov 19 '18 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.