From 7958ad5e7cad34346f408bf26e582df4d962d30f Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Sat, 25 Feb 2023 23:00:50 +0000 Subject: [PATCH] Create blank config if it did not exist --- devine/core/config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/devine/core/config.py b/devine/core/config.py index 9f57ce0..2dd1f7c 100644 --- a/devine/core/config.py +++ b/devine/core/config.py @@ -74,9 +74,9 @@ class Config: # noinspection PyProtectedMember -try: - config = Config.from_yaml(Config._Directories.user_configs / Config._Filenames.root_config) -except FileNotFoundError: - config = Config() +config_path = Config._Directories.user_configs / Config._Filenames.root_config +if not config_path.is_file(): + config_path.write_text("") +config = Config.from_yaml(config_path) __ALL__ = (config,)