fix: use hermes_constants.get_hermes_home() for reliable path resolution
This commit is contained in:
1 parent
e0ad347474
commit
5330081c43
1 file changed
+7
-1
+7
-1
@@ -19,8 +19,14 @@ from typing import Optional
|
|||||||
# ── Helpers ──────────────────────────────────────────────────────────
|
# ── Helpers ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
def _hermes_home() -> Path:
|
def _hermes_home() -> Path:
|
||||||
|
"""Return Hermes home, delegating to the authoritative source when available."""
|
||||||
import os, sys
|
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:
|
if "HERMES_HOME" in os.environ:
|
||||||
return Path(os.environ["HERMES_HOME"])
|
return Path(os.environ["HERMES_HOME"])
|
||||||
# Windows: %LOCALAPPDATA%\hermes
|
# Windows: %LOCALAPPDATA%\hermes
|
||||||
|
|||||||
Reference in new issue
Block a user