I would like to drush enable a bunch of modules in a certain environment via a shell script that runs EVERY TIME the environment rebuilds when new code is committed. (This saves me from having to have access to a drush terminal when I want to first install a module in an environment, but means I don't know if module is being enabled for the first time or if it was enabled long ago)
I'm concerned there might be consequences of repeatedly enabling already enabled modules. Is this true?
If yes, I'm trying to find a drush command to enable a module only if it's not already enabled.
For example, I have seen this page:
drush en `drush pm-list --status="disabled,not installed" --pipe`
which enables all disabled modules.
and
drush dis `cat tmp.txt` --yes
which disables all modules listed in tmp.txt
I want something like:
drush en `magicfunction(tmp.txt, `drush pm-list --status="disabled" --pipe`)`
where magicfunction
is some linux command line magic that returns the names of modules listed in tmp.txt
that are also in the list of not enabled modules.
Any ideas?
drush pm-enable some_already_enabled_module
, drush will simply skip it. So there is no harm there, just list all modules you need. Drush will take care of it. It simply responds with a messagemodule_name is already enabled
.