Skip to content

Commit

Permalink
fix: Restore default settings logic
Browse files Browse the repository at this point in the history
Make sure that the default settings can be restored even if they don't exist at first
  • Loading branch information
zevlee committed Jan 23, 2025
1 parent 9bb8a2f commit 18f5fc7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions passphraser/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 18f5fc7

Please sign in to comment.