fix: Support config.yml, config.yaml (#111)

This commit is contained in:
Bryan 2024-04-15 18:05:50 +08:00 committed by GitHub
parent 4da7e6fa4b
commit 493939017e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -174,7 +174,7 @@ class ConfigManager:
return True
def load_from_yml(self):
for i in ['config_example.yml', 'config.yaml']:
for i in ['config_example.yml', 'config.yaml', 'config.yml']:
if not os.path.isfile(os.path.join(self.root_path, i)):
continue
loaded = self.from_yaml(i)
@ -197,7 +197,8 @@ class ConfigManager:
Error: No config file found.
You can run `cp config_example.yml {root_path}/config_example.yml`, and edit it.
You can run `cp config_example.yml {root_path}/config.yml`, and edit it.
"""
raise ImportError(msg)
return config