mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
Add docker support, fix config dir
This commit is contained in:
+12
-2
@@ -67,8 +67,18 @@ def get_version():
|
||||
# Define config path
|
||||
def get_user_config_path():
|
||||
from platformdirs import user_config_dir
|
||||
# Use platformdirs to get the user configuration directory
|
||||
config_dir = user_config_dir("abogen", appauthor=False, roaming=True)
|
||||
# TODO Config directory is changed for Linux and MacOS. But if old config exists, it will be used.
|
||||
# On non‑Windows, prefer ~/.config/abogen if it already exists
|
||||
if platform.system() != "Windows":
|
||||
custom_dir = os.path.join(os.path.expanduser("~"), ".config", "abogen")
|
||||
if os.path.exists(custom_dir):
|
||||
config_dir = custom_dir
|
||||
else:
|
||||
config_dir = user_config_dir("abogen", appauthor=False, roaming=True)
|
||||
else:
|
||||
# Windows and fallback case
|
||||
config_dir = user_config_dir("abogen", appauthor=False, roaming=True)
|
||||
|
||||
os.makedirs(config_dir, exist_ok=True)
|
||||
return os.path.join(config_dir, "config.json")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user