fix: use hermes_constants.get_hermes_home() for reliable path resolution

This commit is contained in:
2026-06-12 22:37:52 +03:00
parent e0ad347474
commit 5330081c43

View File

@@ -19,8 +19,14 @@ from typing import Optional
# ── Helpers ──────────────────────────────────────────────────────────
def _hermes_home() -> Path:
"""Return Hermes home, delegating to the authoritative source when available."""
import os, sys
# Hermes'in resmi yolunu bul
# Use official hermes_constants if available (handles profiles, overrides, etc.)
try:
from hermes_constants import get_hermes_home
return get_hermes_home()
except ImportError:
pass
if "HERMES_HOME" in os.environ:
return Path(os.environ["HERMES_HOME"])
# Windows: %LOCALAPPDATA%\hermes