fix(installer): deduplicate repeated tool selections (#777)

Signed-off-by: Mr-Neutr0n <harikp2002@gmail.com>
This commit is contained in:
hari
2026-08-26 08:50:52 -05:00
committed by GitHub
parent 3464daa3c6
commit 9572c66428
+9 -1
View File
@@ -1247,7 +1247,15 @@ main() {
local valid=false _vt local valid=false _vt
for _vt in "${ALL_TOOLS[@]}"; do [[ "$_vt" == "$_t" ]] && valid=true && break; done for _vt in "${ALL_TOOLS[@]}"; do [[ "$_vt" == "$_t" ]] && valid=true && break; done
$valid || { err "Unknown tool '$_t'. Valid: ${ALL_TOOLS[*]}"; exit 1; } $valid || { err "Unknown tool '$_t'. Valid: ${ALL_TOOLS[*]}"; exit 1; }
_cleaned+=("$_t") # A repeated --tool value would otherwise launch duplicate workers in
# --parallel mode and make the reported install count misleading.
local duplicate=false _selected
if [[ ${#_cleaned[@]} -gt 0 ]]; then
for _selected in "${_cleaned[@]}"; do
[[ "$_selected" == "$_t" ]] && { duplicate=true; break; }
done
fi
$duplicate || _cleaned+=("$_t")
done done
_tool_list=("${_cleaned[@]}") _tool_list=("${_cleaned[@]}")
fi fi