File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 7
7
]
8
8
9
9
10
- from typing import Dict
10
+ from typing import Dict , Union
11
11
12
12
from beet import Context , ListOption , PluginOptions , configurable
13
13
from beet .core .utils import snake_case
14
14
15
15
16
16
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 ]] = {}
19
19
20
20
21
21
def beet_default (ctx : Context ):
@@ -31,8 +31,11 @@ def render(ctx: Context, opts: RenderOptions):
31
31
snake_case (file_type .__name__ ): file_type for file_type in file_types
32
32
}
33
33
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 ])
36
39
37
40
for group , render_options in groups .items ():
38
41
try :
You can’t perform that action at this time.
0 commit comments