Skip to content

Commit f5d3750

Browse files
committed
feat: make it possible to render everything
1 parent 145256f commit f5d3750

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

beet/contrib/render.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
]
88

99

10-
from typing import Dict
10+
from typing import Dict, Union
1111

1212
from beet import Context, ListOption, PluginOptions, configurable
1313
from beet.core.utils import snake_case
1414

1515

1616
class RenderOptions(PluginOptions):
17-
resource_pack: Dict[str, ListOption[str]] = {}
18-
data_pack: Dict[str, ListOption[str]] = {}
17+
resource_pack: Union[Dict[str, ListOption[str]], ListOption[str]] = {}
18+
data_pack: Union[Dict[str, ListOption[str]], ListOption[str]] = {}
1919

2020

2121
def beet_default(ctx: Context):
@@ -31,8 +31,11 @@ def render(ctx: Context, opts: RenderOptions):
3131
snake_case(file_type.__name__): file_type for file_type in file_types
3232
}
3333

34-
for singular in list(group_map):
35-
group_map.setdefault(f"{singular}s", group_map[singular])
34+
if isinstance(groups, ListOption):
35+
groups = {k: groups for k in group_map}
36+
else:
37+
for singular in list(group_map):
38+
group_map.setdefault(f"{singular}s", group_map[singular])
3639

3740
for group, render_options in groups.items():
3841
try:

0 commit comments

Comments
 (0)