Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I find myself constantly updating and reverting many features at once in specific packages. It can be frustrating specifying all of the feature names on the command line when calling drush up feature1 feature2 [feature3] over and over and over again. I've addressed this in the included patch. This is my first contribution to any Drupal project, so if something is amiss, definitely point it out and I'll address it (or someone else can, woot for open source).
Added the following commands:
- features-list-packages (flp)
- Lists all feature packages. Specify --reg to see the human-readable names.
- features-update-packages (fup)
- Updates all features in specific packages. Use a space-separated list of feature machine names.
- features-revert-packages (frp)
- Reverts all listed feature packages. Use a space-separated list of feature machine names.
Comment | File | Size | Author |
---|---|---|---|
#6 | Screen Shot 2014-07-22 at 9.27.40 AM.png | 155.37 KB | lpeabody |
#4 | features_mass_update_packages-1956640-4.patch | 5.05 KB | undertext |
#1 | features-1956640.patch | 5.16 KB | lpeabody |
features.drush_.inc_.patch | 5.16 KB | lpeabody | |
Comments
Comment #1
lpeabody CreditAttribution: lpeabody commentedReattached patch with proper name.
Comment #2
lpeabody CreditAttribution: lpeabody commentedUpdating to needs review. Been using for over a week now without issue.
Comment #3
hefox CreditAttribution: hefox commentedThis is a good idea, but instead of new commands perhaps instead argument to fua/fra/etc?
Comment #4
undertext CreditAttribution: undertext commentedI have added '--packages' option to fl/fua/fra drush commands.
Comment #5
lpeabody CreditAttribution: lpeabody commentedThanks undertext for enhancing this. I haven't had the opportunity to work on this for a while now. Gotta love the community.
Comment #6
lpeabody CreditAttribution: lpeabody commentedLooks good, one point though...
When running
drush fua --features=Features
, should this list should be equivalent to the list when having rundrush fra --pacakages=Features
? Ultimately it will just abort for each feature that doesn't need to be updated, but it would be cleaner if features that did not need to be updated were just skipped in this list. Honestly, I don't even remember if this is how it worked for me originally, it's just an afterthought.Ultimately, this patch is sound and works as advertised. Thanks undertext.
Comment #7
m1r1k CreditAttribution: m1r1k commentedComment #8
hefox CreditAttribution: hefox commentedI'm fairly certain packages can have spaces in them, so space delimited won't really work tmk.
Comment #9
lpeabody CreditAttribution: lpeabody commentedSpace delimited isn't accurate, I think @undertext misspoke. He collects the options via
drush_get_option_list
, which collects options that are comma separated, not space separated, so the help text needs to be updated. So it's sort of a non-issue/documentation issue I believe.In addition, I don't think the feature revert process is correctly invoked on each features in the package, as I get the following error when attempting to revert all.
Unknown option: --packages. See `drush help features-revert` for available options. To suppress this error, add the option --strict=0.
My original code didn't have this problem. I'll look at adjusting the revert command invocation and re-roll.