ty checking
This commit is contained in:
@@ -30,15 +30,9 @@ class SkillFilesBundle:
|
||||
@classmethod
|
||||
def from_paths(cls, slug: str, paths: set[MarkdownDocument]) -> Self:
|
||||
skill = next(iter(p for p in paths if p.relpath.name == "SKILL.md"))
|
||||
groups = {
|
||||
k: tuple(v)
|
||||
for k, v in groupby(
|
||||
paths,
|
||||
key=lambda p: fnmatch(p.relpath.as_posix(), f"skills/{slug}/references/*.md"),
|
||||
)
|
||||
}
|
||||
references = groups.get(True, ())
|
||||
other = tuple(p for p in groups.get(False, ()) if p != skill)
|
||||
sorted_paths = tuple(sorted(paths, key=lambda p: p.relpath.as_posix()))
|
||||
references = tuple(p for p in sorted_paths if fnmatch(p.relpath.as_posix(), f"skills/{slug}/references/*.md"))
|
||||
other = tuple(p for p in sorted_paths if p not in references and p != skill)
|
||||
return cls(
|
||||
slug=slug,
|
||||
skill=skill,
|
||||
|
||||
Reference in New Issue
Block a user