refactor: in components ext run, display only those extensions that actually have subcommands (#1251)

This commit is contained in:
Juro Oravec 2025-06-10 11:11:24 +02:00 committed by GitHub
parent 458e1894db
commit 3fc96daa9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 13 deletions

View file

@ -19,6 +19,9 @@ from django_components.util.command import ComponentCommand
def _gen_subcommands() -> List[Type[ComponentCommand]]:
commands: List[Type[ComponentCommand]] = []
for extension in extensions.extensions:
if not extension.commands:
continue
ExtCommand = type(
"ExtRunSubcommand_" + extension.name,
(ComponentCommand,),