ossobuffo / switch_to_minimal
Drush hook to switch Drupal install profile to ‘minimal’.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:drupal-drush
Requires
- php: >=8.3.0
- drush/drush: >=13.0.0
README
This command file adds a pre-command hook to the deploy
command, which
ensures that the install profile is set to minimal
. If it is not
minimal
, the profile is changed. This hook will run EVERY TIME
drush deploy
is invoked. It is perfectly harmless to keep this code
around after you switch profiles; it will simply bail with the message
“Current profile is already minimal.”
It also provides the command switch-to-minimal
which will perform the
profile switch without invoking drush deploy
.
As of Drush 13.6.0.0, there is a patch that must be applied to drush
itself to make the pre-command hook be detected by drush deploy
.
A copy of this patch is included; you should add it your project’s
patchset (either composer.patches.json
or the extra.patches
key
in `composer.json). For more information, see
Drush issue #6304.
The command file will be installed in ${PROJECT_ROOT}/drush/Commands/contrib/switch_to_minimal
.
Why would I need this?
This is designed to help move projects away from abandoned or deprecated
contrib or custom profiles. If your automated deployment process is to
push code and then run drush deploy
, this should seamlessly integrate
with that workflow.
Caveats
Obviously you should remove this from your project if you want to switch to another non-minimal profile.
If the profile you are moving away from includes contrib modules or libraries
in its composer.json
, you should make sure that they are now pulled in by
your current main composer.json
.
This could quite possibly work with older versions of Drush than
advertised in the composer.json
file. I have not tested, and do not
consider it worth my while to do so.