Skip to content

Commit

Permalink
fix: use beet.contrib.load to handle the load option
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Nov 8, 2021
1 parent 4971c40 commit c23e4ad
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions beet/toolchain/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

from copy import deepcopy
from dataclasses import dataclass
from glob import glob
from importlib.metadata import entry_points
from pathlib import Path
from typing import ClassVar, Iterable, Iterator, List, Optional, Sequence

from beet.contrib.load import load
from beet.contrib.render import render
from beet.core.utils import FileSystemPath, intersperse, log_time, normalize_string
from beet.core.watch import DirectoryWatcher, FileChanges
Expand Down Expand Up @@ -293,10 +293,12 @@ def bootstrap(self, ctx: Context):
pack_configs = [self.config.resource_pack, self.config.data_pack]
pack_suffixes = ["_resource_pack", "_data_pack"]

for config, pack in zip(pack_configs, ctx.packs):
for pattern in config.load:
for path in glob(pattern):
pack.load(path)
ctx.require(
load(
resource_pack=self.config.resource_pack.load,
data_pack=self.config.data_pack.load,
)
)

ctx.require(
render(
Expand Down

0 comments on commit c23e4ad

Please sign in to comment.