chore: prepare Hermes for Homebrew packaging (#4099)

Co-authored-by: Yabuku-xD <78594762+Yabuku-xD@users.noreply.github.com>
This commit is contained in:
Teknium 2026-03-30 17:34:43 -07:00 committed by GitHub
parent 11aa44d34d
commit e64b047663
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 400 additions and 56 deletions

View file

@ -17,6 +17,20 @@ def get_hermes_home() -> Path:
return Path(os.getenv("HERMES_HOME", Path.home() / ".hermes"))
def get_optional_skills_dir(default: Path | None = None) -> Path:
"""Return the optional-skills directory, honoring package-manager wrappers.
Packaged installs may ship ``optional-skills`` outside the Python package
tree and expose it via ``HERMES_OPTIONAL_SKILLS``.
"""
override = os.getenv("HERMES_OPTIONAL_SKILLS", "").strip()
if override:
return Path(override)
if default is not None:
return default
return get_hermes_home() / "optional-skills"
def get_hermes_dir(new_subpath: str, old_name: str) -> Path:
"""Resolve a Hermes subdirectory with backward compatibility.