Make pm:install and pm:uninstall respect --simulate option#5152
Make pm:install and pm:uninstall respect --simulate option#5152weitzman merged 3 commits intodrush-ops:11.xfrom
pm:install and pm:uninstall respect --simulate option#5152Conversation
|
Seems a good proposal to me.
|
I mostly copied the existing code here. Do you want to change the output of the command itself to use |
|
I've made changes 2 and 3 but have omitted 1. Changing to |
--dry-run option to pm:install and pm:uninstallpm:install and pm:uninstall respect --simulate option
|
Thanks! |
In Drush 8 it was possible to pass
--notopm:uninstallto let it output only what modules would be uninstalled without actually uninstalling any modules. This was removed in Drush 9 after discussion in #205 (PR #1057 was declined as a result).However, we had some automation that used this to see what would be uninstalled so that this could be reported for user verification, even in the case only a single module would be uninstalled. This is now broken and that command uninstalls the module when it's the only one being uninstalled.
To preserve the new desired behaviour but still easily allow automation to determine what changes would be made by running
pm:installorpm:uninstallthis PR adds a--dry-runoption that will not actually perform any of the changes.An alternative implementation would be to provide entirely separate commands, but that feels like overkill.