Add missing environmental variable checks
Encryption keys, themes and general config dir (if used) were stored in the default directories even if Moment-specific environmental variables were present.
This commit is contained in:
parent
602dcbf15f
commit
4fa44f7510
|
@ -430,11 +430,16 @@ class Backend:
|
|||
# General functions
|
||||
|
||||
async def get_config_dir(self) -> Path:
|
||||
return Path(self.appdirs.user_config_dir)
|
||||
return Path(
|
||||
os.environ.get("MOMENT_CONFIG_DIR") or
|
||||
self.appdirs.user_config_dir,
|
||||
)
|
||||
|
||||
|
||||
async def get_theme_dir(self) -> Path:
|
||||
path = Path(self.appdirs.user_data_dir) / "themes"
|
||||
path = Path(
|
||||
os.environ.get("MOMENT_DATA_DIR") or self.appdirs.user_data_dir,
|
||||
) / "themes"
|
||||
path.mkdir(parents=True, exist_ok=True)
|
||||
return path
|
||||
|
||||
|
|
|
@ -165,7 +165,10 @@ class MatrixClient(nio.AsyncClient):
|
|||
device_id: Optional[str] = None,
|
||||
) -> None:
|
||||
|
||||
store = Path(backend.appdirs.user_data_dir) / "encryption"
|
||||
store = Path(
|
||||
os.environ.get("MOMENT_DATA_DIR") or backend.appdirs.user_data_dir,
|
||||
) / "encryption"
|
||||
|
||||
store.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
proxy: Optional[str]
|
||||
|
|
Loading…
Reference in New Issue
Block a user