From 49088ede985fd26df5cf7d190d0795b944ac6a40 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Fri, 14 Aug 2020 20:32:50 +0530 Subject: [PATCH] Fix composer fallback --- src/scripts/darwin.sh | 7 +++---- src/scripts/linux.sh | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index 2e4f1cd4..e5053c6e 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -166,13 +166,12 @@ add_tool() { if [ ! -e "$tool_path" ]; then rm -rf "$tool_path" fi - 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]}") + status_code=$(sudo curl -f -w "%{http_code}" -o "$tool_path" "${curl_opts[@]}" "${urls[0]}") || + status_code=$(sudo curl -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") + status_code=$(sudo curl -w "%{http_code}" -o "$tool_path" "${curl_opts[@]}" "$url") fi if [ "$status_code" = "200" ]; then sudo chmod a+x "$tool_path" diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 74ce18c7..3e63aa7f 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -264,10 +264,10 @@ add_tool() { fi 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]}") + status_code=$(sudo curl -f -w "%{http_code}" -o "$tool_path" "${curl_opts[@]}" "${urls[0]}") || + status_code=$(sudo curl -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") + status_code=$(sudo curl -w "%{http_code}" -o "$tool_path" "${curl_opts[@]}" "$url") fi if [ "$status_code" = "200" ]; then sudo chmod a+x "$tool_path"