Skip to content

Commit

Permalink
Allow config to be named shallow-backup.json, while still supporting …
Browse files Browse the repository at this point in the history
…legacy config
  • Loading branch information
alichtman committed Nov 16, 2023
1 parent dab1ffe commit 45dc133
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion shallow_backup/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 45dc133

Please sign in to comment.