Compare commits

...

1 Commits

Author SHA1 Message Date
Timmy Time
02e77e065f Fix #479: Remove hardcoded ~/.hermes paths from optional-skills
Some checks failed
Forge CI / smoke-and-build (pull_request) Failing after 1m7s
Fixed two optional-skill scripts that still hardcoded ~/.hermes:
- memento_cards.py: Changed from Path.home() / '.hermes' to proper
  HERMES_HOME expansion
- telephony.py: Changed from '~/.hermes' string to proper expansion

Both now use a _hermes_home() helper that:
1. Reads HERMES_HOME env var
2. Expands ~ if present in the path
3. Falls back to Path.home() / '.hermes' if not set

The migration script (openclaw_to_hermes.py) was left as-is per issue
recommendation since it intentionally references old paths.

Fixes #479
2026-04-13 21:33:00 -04:00
2 changed files with 15 additions and 2 deletions

View File

@@ -15,7 +15,16 @@ import uuid
from datetime import datetime, timedelta, timezone
from pathlib import Path
_HERMES_HOME = Path(os.environ.get("HERMES_HOME", Path.home() / ".hermes"))
def _get_hermes_home() -> Path:
"""Return HERMES_HOME, expanding ~ if needed."""
raw = os.environ.get("HERMES_HOME", "")
if raw:
return Path(raw).expanduser()
return Path.home() / ".hermes"
_HERMES_HOME = _get_hermes_home()
DATA_DIR = _HERMES_HOME / "skills" / "productivity" / "memento-flashcards" / "data"
CARDS_FILE = DATA_DIR / "cards.json"

View File

@@ -69,7 +69,11 @@ class OwnedTwilioNumber:
def _hermes_home() -> Path:
return Path(os.environ.get("HERMES_HOME", "~/.hermes")).expanduser()
"""Return HERMES_HOME, expanding ~ if needed."""
raw = os.environ.get("HERMES_HOME", "")
if raw:
return Path(raw).expanduser()
return Path.home() / ".hermes"
def _env_path() -> Path: