From 6a00444bd4b73964aab77adc78cf7c1cf10fd3ed Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 5 May 2021 23:29:29 -0600 Subject: [PATCH] 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. --- scripts/wk/kit/tools.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/wk/kit/tools.py b/scripts/wk/kit/tools.py index b9282a16..e24ae07b 100644 --- a/scripts/wk/kit/tools.py +++ b/scripts/wk/kit/tools.py @@ -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?