Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't overwrite local config files #210

Merged
merged 3 commits into from
Aug 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion template/build/core/phing/tasks/properties.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@

<!-- Extract PHP variable values from local.settings.php. -->
<property name="local.settings.file" value="${docroot}/sites/${multisite.name}/settings/local.settings.php" />
<copy file="${docroot}/sites/${multisite.name}/settings/default.local.settings.php" tofile="${local.settings.file}" overwrite="false" verbose="true"/>
<if>
<not>
<available file="${local.settings.file}" type="file" />
</not>
<then>
<copy file="${docroot}/sites/${multisite.name}/settings/default.local.settings.php" tofile="${local.settings.file}" verbose="true"/>
</then>
</if>

<echo>Executing commands against multisite "${multisite.name}"</echo>
<echo>Using settings file ${local.settings.file}</echo>
Expand Down
37 changes: 30 additions & 7 deletions template/build/core/phing/tasks/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,36 @@

<target name="setup:drupal:settings" description="Create local settings files using default settings files.">
<chmod mode="0755" file="${docroot}/sites/default" failonerror="false" verbose="true"/>
<copy file="${repo.root}/example.project.local.yml" tofile="${repo.root}/project.local.yml" overwrite="false"/>
<copy file="${docroot}/sites/${multisite.name}/settings/default.local.settings.php" tofile="${docroot}/sites/${multisite.name}/settings/local.settings.php" overwrite="false"/>
<copy file="${docroot}/sites/${multisite.name}/default.local.drushrc.php" tofile="${docroot}/sites/${multisite.name}/local.drushrc.php" overwrite="false">
<filterchain>
<expandproperties />
</filterchain>
</copy>

<if>
<not>
<available file="${repo.root}/project.local.yml" type="file" />
</not>
<then>
<copy file="${repo.root}/example.project.local.yml" tofile="${repo.root}/project.local.yml" />
</then>
</if>
<if>
<not>
<available file="${docroot}/sites/${multisite.name}/settings/local.settings.php" type="file" />
</not>
<then>
<copy file="${docroot}/sites/${multisite.name}/settings/default.local.settings.php" tofile="${docroot}/sites/${multisite.name}/settings/local.settings.php" />
</then>
</if>
<if>
<not>
<available file="${docroot}/sites/${multisite.name}/local.drushrc.php" type="file" />
</not>
<then>
<copy file="${docroot}/sites/${multisite.name}/default.local.drushrc.php" tofile="${docroot}/sites/${multisite.name}/local.drushrc.php">
<filterchain>
<expandproperties />
</filterchain>
</copy>
</then>
</if>

<!-- Re-extract value of $options['uri'] in case it was not yet set. -->
<!-- @todo Add multisite support. -->
<phpVariable file="${repo.root}/drush/drushrc.php" variable="options[uri]" outputProperty="local_url" />
Expand Down