Added --config-location argument

This commit is contained in:
Mike Schwörer 2021-11-18 22:24:45 +01:00
parent 8cd868f317
commit 50187c5aeb
No known key found for this signature in database
GPG Key ID: D3C7172E0A70F8CF
1 changed files with 6 additions and 1 deletions

View File

@ -42,7 +42,12 @@ class Config:
@classmethod
def load(cls, args) -> None:
app_dir = os.path.dirname(__file__)
true_config_file_path = os.path.join(app_dir, CONFIG_FILE_PATH)
config_fp = CONFIG_FILE_PATH
if args.config_location:
config_fp = args.config_location
true_config_file_path = os.path.join(app_dir, config_fp)
if not os.path.exists(true_config_file_path):
with open(true_config_file_path, 'w', encoding='utf-8') as config_file: