From 254a7635fba518fcf410a3e0ad356a6b5a29d109 Mon Sep 17 00:00:00 2001 From: Aaron Lichtman Date: Thu, 16 Nov 2023 02:03:25 -0800 Subject: [PATCH] Allow config to be named shallow-backup.json, while still supporting legacy config --- shallow_backup/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shallow_backup/config.py b/shallow_backup/config.py index 7240f642..78bb9b27 100644 --- a/shallow_backup/config.py +++ b/shallow_backup/config.py @@ -22,10 +22,14 @@ def get_config_path() -> str: :return: Path to config. """ test_config_path = environ.get("SHALLOW_BACKUP_TEST_CONFIG_PATH", None) + legacy_config = path.join(get_xdg_config_path(), "shallow-backup.conf") + new_config_path = path.join(get_xdg_config_path(), "shallow-backup.json") if test_config_path: return test_config_path + elif path.exists(legacy_config): + return legacy_config else: - return path.join(get_xdg_config_path(), "shallow-backup.conf") + return new_config_path def get_config() -> dict: