Skip to content

Commit

Permalink
Import features twice. (#1073)
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell authored and grasmash committed Feb 10, 2017
1 parent b729067 commit 762d679
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions phing/tasks/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,16 @@
</drush>
<!-- Revert all features. -->
<foreach list="${cm.features.bundle}" param="bundle" target="setup:update:features-import" />
<!-- Revert all features again! -->
<!-- @see https://www.drupal.org/node/2851532 -->
<foreach list="${cm.features.bundle}" param="bundle" target="setup:update:features-import" />
<if>
<equals arg1="${cm.features.no-overrides}" arg2="true"/>
<then>
<echo>Checking for features overrides...</echo>
<foreach list="${cm.features.bundle}" param="bundle" target="setup:update:features-override-check" />
</then>
</if>
</then>
</if>
<!-- Rebuild caches. -->
Expand Down Expand Up @@ -290,17 +300,14 @@
<drush command="fra" assume="yes" alias="${drush.alias}" passthru="false">
<option name="bundle">${bundle}</option>
</drush>
</target>

<target name="setup:update:features-override-check" description="Checks if features are overridden.">
<exec dir="${docroot}" command="${drush.cmd} fl --bundle=${bundle} | grep -Ei '(changed|conflicts|added)( *)$'" outputProperty="features.overrides"/>
<if>
<equals arg1="${cm.features.no-overrides}" arg2="true"/>
<istrue value="${features.overrides}"/>
<then>
<echo>Checking for features overrides...</echo>
<exec dir="${docroot}" command="${drush.cmd} fl --bundle=${bundle} | grep -Ei '(changed|conflicts|added)( *)$'" outputProperty="features.overrides"/>
<if>
<istrue value="${features.overrides}"/>
<then>
<fail>A feature in the ${bundle} bundle is overridden. You must re-export this feature to incorporate the changes.</fail>
</then>
</if>
<fail>A feature in the ${bundle} bundle is overridden. You must re-export this feature to incorporate the changes.</fail>
</then>
</if>
</target>
Expand Down

0 comments on commit 762d679

Please sign in to comment.