From 18f5fc77168015ac201aac09b248fe2a0a444c2b Mon Sep 17 00:00:00 2001 From: Zev Lee <60147316+zevlee@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:34:23 -0600 Subject: [PATCH] fix: Restore default settings logic Make sure that the default settings can be restored even if they don't exist at first --- passphraser/application.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/passphraser/application.py b/passphraser/application.py index 93b860d..100a855 100644 --- a/passphraser/application.py +++ b/passphraser/application.py @@ -45,15 +45,15 @@ def do_startup(self): join(APPDIR, "wordlists"), join(CONF, "wordlists") ) + if not exists(join(CONF, "default.json")): + with open(join(CONF, "default.json"), "w") as d: + d.write(dumps(DEFAULT)) + d.close() if not exists(join(CONF, "settings.json")): with open(join(CONF, "settings.json"), "w") as s: default = read_config("default.json") s.write(dumps(default)) s.close() - if not exists(join(CONF, "default.json")): - with open(join(CONF, "default.json"), "w") as d: - d.write(dumps(DEFAULT)) - d.close() # Validate config files validate_config("default.json")