Add a "base" option for installing only base modules via drush site-install.

This commit is contained in:
Michael Stenta 2021-05-26 11:45:14 -04:00
parent 360e133164
commit 6489d34660
1 changed files with 10 additions and 5 deletions

View File

@ -57,16 +57,21 @@ function farm_install_modules(array &$install_state) {
$all = farm_modules();
// Load the list of modules that should be installed.
// If provided, use the modules defined in farm_install_modules.module
// profile arguments. We assume this is an array of module machine names,
// unless it is simply the string "all", which is a shortcut for installing
// all modules.
// If provided, use the modules defined in farm.modules profile argument.
// We assume this is an array of module machine names, unless it is simply a
// string, which is interpreted as a shortcut for installing a set of modules.
// Available shortcuts are:
// - "all" (installs all modules)
// - "base" (installs base modules)
if (!empty($install_state['forms']['farm']['modules'])) {
$modules_arg = $install_state['forms']['farm']['modules'];
$all = farm_modules();
if ($modules_arg === 'all') {
$all = farm_modules();
$modules = array_merge(array_keys($all['base']), array_keys($all['default']), array_keys($all['optional']));
}
elseif ($modules_arg === 'base') {
$modules = array_keys($all['base']);
}
else {
$modules = Json::decode($modules_arg);
}