Support multiple architectures in get_tool_path()

This change was necessary to avoid using the wrong paths for
tools with speparate executables for different architectures.
This commit is contained in:
2Shirt 2021-05-05 23:29:29 -06:00
parent 4872a18e91
commit 6a00444bd4
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -147,10 +147,12 @@ def find_kit_dir(name=None):
def get_tool_path(folder, name, check=True):
"""Get tool path, returns pathlib.Path"""
bin_dir = find_kit_dir('.bin')
name_arch = f'{name}{ARCH}'
# "Search"
tool_path = bin_dir.joinpath(f'{folder}/{name}{ARCH}.exe')
if not tool_path.exists():
tool_path = bin_dir.joinpath(f'{folder}/{name_arch}.exe')
if not (tool_path.exists() or name_arch in SOURCES):
# Use "default" path instead
tool_path = tool_path.with_stem(name)
# Missing?