Skip to content

Instantly share code, notes, and snippets.

@mootari
Last active August 29, 2015 14:09
Show Gist options
  • Save mootari/d3fc1d6b3d94384b778e to your computer and use it in GitHub Desktop.
Save mootari/d3fc1d6b3d94384b778e to your computer and use it in GitHub Desktop.
Draft: features-revert-updated

We're not using the version here, as versions can be difficult to parse and compare. Instead we rely on an "iterator" key (working title) that gets incremented with each feature update. Except for initially adding the iterator to a feature's info file there are no further manual changes involved.

Updating a feature

  1. When a feature gets updated (todo: find hook), check if system info for the feature contains an "iterator" key.
  2. If "iterator" key exists, increment by one, and add to the info output.

Reverting features

  1. On drush command invocation ("features-revert-updated" or "fru"), find all features modules (todo: find hook) and check if system info for each feature contains an "iterator" key.
  2. If iterator key exists, retrieve stored iterator for feature. If stored iterator not found or less then present interator, add feature to list of features to be reverted.
  3. Revert all features that have been added to the revert list during 2.
  4. Update (or add) feature names and iterator values in local iterator store (e.g. variable, custom table).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment