Use cached composer builds

This commit is contained in:
Shivam Mathur
2020-08-04 20:47:30 +05:30
parent 9dae796baf
commit 91bd6b26c2
6 changed files with 35 additions and 17 deletions

View File

@ -167,7 +167,13 @@ add_tool() {
rm -rf "$tool_path"
fi
status_code=$(sudo curl -s -w "%{http_code}" -o "$tool_path" "${curl_opts[@]}" "$url")
if [ "$tool" = "composer" ]; then
IFS="," read -r -a urls <<< "$url"
status_code=$(sudo curl -s -w "%{http_code}" -o "$tool_path" "${curl_opts[@]}" "${urls[0]}") ||
status_code=$(sudo curl -s -w "%{http_code}" -o "$tool_path" "${curl_opts[@]}" "${urls[1]}")
else
status_code=$(sudo curl -s -w "%{http_code}" -o "$tool_path" "${curl_opts[@]}" "$url")
fi
if [ "$status_code" = "200" ]; then
sudo chmod a+x "$tool_path"
if [ "$tool" = "composer" ]; then