From 6b572842904675dd9dbd6db960b58055c10349f6 Mon Sep 17 00:00:00 2001 From: Nathan Shaaban <86252985+ctrlaltf24@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:24:02 -0700 Subject: [PATCH] fix: migrate config from old location to new Fixes: #213 --- ou_dedetai/config.py | 5 ++++- ou_dedetai/main.py | 10 +++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ou_dedetai/config.py b/ou_dedetai/config.py index fdb178a2..2f012455 100644 --- a/ou_dedetai/config.py +++ b/ou_dedetai/config.py @@ -70,7 +70,10 @@ INSTALL_STEP: int = 0 INSTALL_STEPS_COUNT: int = 0 L9PACKAGES = None -LEGACY_CONFIG_FILE = os.path.expanduser("~/.config/Logos_on_Linux/Logos_on_Linux.conf") # noqa: E501 +LEGACY_CONFIG_FILES = [ + os.path.expanduser("~/.config/FaithLife-Community/Logos_on_Linux.json"), # noqa: E501 + os.path.expanduser("~/.config/Logos_on_Linux/Logos_on_Linux.conf") # noqa: E501 +] LLI_AUTHOR = "Ferion11, John Goodman, T. H. Wright, N. Marti" LLI_CURRENT_VERSION = "4.0.0-beta.2" LLI_LATEST_VERSION: Optional[str] = None diff --git a/ou_dedetai/main.py b/ou_dedetai/main.py index bffe114f..b9fadb11 100755 --- a/ou_dedetai/main.py +++ b/ou_dedetai/main.py @@ -330,9 +330,13 @@ def set_config(): utils.set_default_config() # Update config from CONFIG_FILE. - if not utils.file_exists(config.CONFIG_FILE) and utils.file_exists(config.LEGACY_CONFIG_FILE): # noqa: E501 - config.set_config_env(config.LEGACY_CONFIG_FILE) - utils.write_config(config.CONFIG_FILE) + if not utils.file_exists(config.CONFIG_FILE): # noqa: E501 + for legacy_config in config.LEGACY_CONFIG_FILES: + if utils.file_exists(legacy_config): + config.set_config_env(legacy_config) + utils.write_config(config.CONFIG_FILE) + os.remove(legacy_config) + break else: config.set_config_env(config.CONFIG_FILE)