From 2fc508f43d9599c960a7924f90bf0e29a08ff997 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 26 Nov 2020 11:17:48 +0530 Subject: [PATCH] Fix shellcheck warning in add_tool --- src/scripts/linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 395f913f..891dac39 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -180,7 +180,7 @@ add_tool() { status_code=$(sudo curl -w "%{http_code}" -o "$tool_path" "${curl_opts[@]}" "$url") fi if [ "$status_code" != "200" ] && [[ "$url" =~ .*github.com.*releases.*latest.* ]]; then - url=$(echo $url | sed -e "s|releases/latest/download|releases/download/$(curl "${curl_opts[@]}" "$(echo "$url" | cut -d '/' -f '1-5')/releases" | grep -Eo -m 1 "([0-9]+\.[0-9]+\.[0-9]+)/$(echo "$url" | sed -e "s/.*\///")" | cut -d '/' -f 1)|") + url="${url//releases\/latest\/download/releases/download/$(curl "${curl_opts[@]}" "$(echo "$url" | cut -d '/' -f '1-5')/releases" | grep -Eo -m 1 "([0-9]+\.[0-9]+\.[0-9]+)/$(echo "$url" | sed -e "s/.*\///")" | cut -d '/' -f 1)}" status_code=$(sudo curl -w "%{http_code}" -o "$tool_path" "${curl_opts[@]}" "$url") fi if [ "$status_code" = "200" ]; then