Skip to content

Commit

Permalink
check for new settings.ddev.php before copy
Browse files Browse the repository at this point in the history
  • Loading branch information
byrond authored Jan 25, 2023
1 parent 2b9cacd commit 798df4a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions targets/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,15 @@
<!-- The one that's available is the location we're moving from. -->
<available file="${build.dir}/web/core" type="dir" property="drupal.root.old" value="web" />
<available file="${build.dir}/docroot/core" type="dir" property="drupal.root.old" value="docroot" />
<available file="${build.dir}/${drupal.root.old}/sites/default/settings.ddev.php" type="file" property="ddev_settings_exists" value="true" />
<available file="${build.dir}/${drupal.root}/sites/default/settings.ddev.php" type="file" property="ddev_settings_exists" value="true" />
<available file="${build.dir}/${drupal.root.old}/sites/default/settings.ddev.php" type="file" property="old_ddev_settings_exists" value="true" />

<!-- Copy settings.ddev.php if it doesn't exist in the old drupal root. -->
<if>
<not><equals arg1="${ddev_settings_exists}" arg2="1" /></not>
<and>
<equals arg1="${ddev_settings_exists}" arg2="1" />
<not><equals arg1="${old_ddev_settings_exists}" arg2="1" /></not>
</and>
<then>
<echo msg="Copying settings.ddev.php to old drupal root." />
<exec command="cp ${drupal.root}/sites/default/settings.ddev.php ${drupal.root.old}/sites/default" dir="${build.dir}" checkreturn="true" logoutput="true" />
Expand Down

0 comments on commit 798df4a

Please sign in to comment.