Merge pull request #14687 from Art4/fix-console-addon-list

Fix list enabled/disabled addons
This commit is contained in:
Hypolite Petovan 2025-01-12 22:46:55 -05:00 committed by GitHub
commit 5de04f965a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -121,27 +121,28 @@ HELP;
$this->out($this->getHelp());
return false;
}
foreach (AddonCore::getAvailableList() as $addon) {
$addon_name = $addon[0];
$enabled = AddonCore::isEnabled($addon_name) ? "enabled" : "disabled";
switch ($subCmd) {
case 'all':
$table->addRow([$addon_name, $enabled]);
break;
case 'enabled':
if (!$enabled) {
continue 2;
}
$table->addRow([$addon_name]);
case 'disabled':
if ($enabled) {
continue 2;
}
$table->addRow([$addon_name]);
break;
$enabled = AddonCore::isEnabled($addon_name);
if ($subCmd === 'all') {
$table->addRow([$addon_name, $enabled ? 'enabled' : 'disabled']);
continue;
}
if ($subCmd === 'enabled' && $enabled === true) {
$table->addRow([$addon_name]);
continue;
}
if ($subCmd === 'disabled' && $enabled === false) {
$table->addRow([$addon_name]);
continue;
}
}
$this->out($table->getTable());
return 0;