mirror of
https://github.com/19JVJeffery/tiddl-gui.git
synced 2026-10-22 02:42:16 -05:00
Agent-Logs-Url: https://github.com/19JVJeffery/tiddl-gui/sessions/ee218a96-15f4-4124-8eea-902561b3cc4e Co-authored-by: 19JVJeffery <94115228+19JVJeffery@users.noreply.github.com>
24 lines
404 B
Python
24 lines
404 B
Python
from os import environ
|
|
from pathlib import Path
|
|
|
|
|
|
ENV_KEY = "TIDDL_PATH"
|
|
APP_DIR_NAME = ".tiddl"
|
|
|
|
|
|
def get_app_path(env_key: str = ENV_KEY) -> Path:
|
|
if environ.get(env_key):
|
|
return Path(environ[env_key])
|
|
|
|
return Path.home() / APP_DIR_NAME
|
|
|
|
|
|
def create_app_path() -> Path:
|
|
app_path = get_app_path()
|
|
app_path.mkdir(exist_ok=True)
|
|
|
|
return app_path
|
|
|
|
|
|
APP_PATH = create_app_path()
|