mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-08 03:01:47 +00:00
fix: exclude hidden and archive dirs from _find_skill rglob
This commit is contained in:
parent
69692039e9
commit
5bf12eb44a
1 changed files with 3 additions and 1 deletions
|
|
@ -283,11 +283,13 @@ def _find_skill(name: str) -> Optional[Dict[str, Any]]:
|
||||||
external dirs configured via skills.external_dirs. Returns
|
external dirs configured via skills.external_dirs. Returns
|
||||||
{"path": Path} or None.
|
{"path": Path} or None.
|
||||||
"""
|
"""
|
||||||
from agent.skill_utils import get_all_skills_dirs
|
from agent.skill_utils import EXCLUDED_SKILL_DIRS, get_all_skills_dirs
|
||||||
for skills_dir in get_all_skills_dirs():
|
for skills_dir in get_all_skills_dirs():
|
||||||
if not skills_dir.exists():
|
if not skills_dir.exists():
|
||||||
continue
|
continue
|
||||||
for skill_md in skills_dir.rglob("SKILL.md"):
|
for skill_md in skills_dir.rglob("SKILL.md"):
|
||||||
|
if any(part in EXCLUDED_SKILL_DIRS for part in skill_md.parts):
|
||||||
|
continue
|
||||||
if skill_md.parent.name == name:
|
if skill_md.parent.name == name:
|
||||||
return {"path": skill_md.parent}
|
return {"path": skill_md.parent}
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue