Add conditional to recursive strategy searching if in config

This commit is contained in:
Sam Germain 2022-03-31 08:16:41 -06:00
parent b4b809ff8e
commit 2fe5a1594f

View File

@ -167,9 +167,13 @@ class StrategyResolver(IResolver):
:param extra_dir: additional directory to search for the given strategy :param extra_dir: additional directory to search for the given strategy
:return: Strategy instance or None :return: Strategy instance or None
""" """
extra_dirs: List[str] = [ if config['recursive_strategy_search']:
path[0] for path in walk(f"{config['user_data_dir']}/{USERPATH_STRATEGIES}") extra_dirs: List[str] = [
] # sub-directories path[0] for path in walk(f"{config['user_data_dir']}/{USERPATH_STRATEGIES}")
] # sub-directories
else:
extra_dirs = []
if extra_dir: if extra_dir:
extra_dirs.append(extra_dir) extra_dirs.append(extra_dir)