Config: Don't load from file if actions present
Loading from file adds extra overhead for actions that don't rely on file loading. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
ececce172e
commit
852ea8faaa
1 changed files with 7 additions and 5 deletions
|
|
@ -20,11 +20,13 @@ class TabbyConfig(TabbyConfigModel):
|
|||
"""Synchronously loads the global application config"""
|
||||
|
||||
# config is applied in order of items in the list
|
||||
configs = [
|
||||
self._from_file(pathlib.Path("config.yml")),
|
||||
self._from_environment(),
|
||||
self._from_args(unwrap(arguments, {})),
|
||||
]
|
||||
arguments_dict = unwrap(arguments, {})
|
||||
configs = [self._from_environment(), self._from_args(arguments_dict)]
|
||||
|
||||
# If actions aren't present, also look from the file
|
||||
# TODO: Change logic if file loading requires actions in the future
|
||||
if not arguments_dict.get("actions"):
|
||||
configs.insert(0, self._from_file(pathlib.Path("config.yml")))
|
||||
|
||||
merged_config = merge_dicts(*configs)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue