fix: Windows path — use LOCALAPPDATA\hermes
This commit is contained in:
1 parent
90af41044b
commit
e0ad347474
1 file changed
+9
-7
+9
-7
@@ -19,13 +19,15 @@ from typing import Optional
|
|||||||
# ── Helpers ──────────────────────────────────────────────────────────
|
# ── Helpers ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
def _hermes_home() -> Path:
|
def _hermes_home() -> Path:
|
||||||
import os
|
import os, sys
|
||||||
# Windows'ta Hermes %LOCALAPPDATA%\hermes kullanir, ~/.hermes degil
|
# Hermes'in resmi yolunu bul
|
||||||
try:
|
if "HERMES_HOME" in os.environ:
|
||||||
from hermes_constants import get_hermes_home
|
return Path(os.environ["HERMES_HOME"])
|
||||||
return Path(get_hermes_home())
|
# Windows: %LOCALAPPDATA%\hermes
|
||||||
except ImportError:
|
if sys.platform == "win32":
|
||||||
return Path(os.environ.get("HERMES_HOME", os.path.expanduser("~/.hermes")))
|
localappdata = os.environ.get("LOCALAPPDATA", os.path.expanduser("~"))
|
||||||
|
return Path(localappdata) / "hermes"
|
||||||
|
return Path(os.path.expanduser("~/.hermes"))
|
||||||
|
|
||||||
|
|
||||||
def _as_float(v):
|
def _as_float(v):
|
||||||
|
|||||||
Reference in new issue
Block a user