Compare commits

...

1 Commits

Author SHA1 Message Date
b211122291 fix: Expand tilde in get_hermes_home() when HERMES_HOME=~/...
Some checks failed
Forge CI / smoke-and-build (pull_request) Failing after 1m0s
Closes #478. Uses Path.expanduser() to expand ~ to user's home directory.
2026-04-14 01:36:07 +00:00

View File

@@ -12,9 +12,14 @@ def get_hermes_home() -> Path:
"""Return the Hermes home directory (default: ~/.hermes).
Reads HERMES_HOME env var, falls back to ~/.hermes.
Expands ~ to user's home directory if present.
This is the single source of truth — all other copies should import this.
"""
return Path(os.getenv("HERMES_HOME", Path.home() / ".hermes"))
hermes_home = os.getenv("HERMES_HOME")
if hermes_home:
# Expand ~ to user's home directory
return Path(hermes_home).expanduser()
return Path.home() / ".hermes"
def get_optional_skills_dir(default: Path | None = None) -> Path: