Remove tool when its download fails and no previous version exists (#1155)

This commit is contained in:
Andreas Möller
2026-11-08 16:47:45 +05:30
committed by GitHub
parent af64993021
commit a95d9d8a2e
+6 -2
View File
@@ -279,8 +279,12 @@ add_tool() {
sudo cp -a "$tool_path" "$cache_path"
fi
fi
if [ "$status_code" != "200" ] && [ -f "$tool_path.bak" ]; then
sudo mv "$tool_path.bak" "$tool_path"
if [ "$status_code" != "200" ]; then
if [ -f "$tool_path.bak" ]; then
sudo mv "$tool_path.bak" "$tool_path"
else
sudo rm -f "$tool_path"
fi
fi
sudo rm -f "$tool_path.bak"
fi