Skip to content

Commit

Permalink
fix: Fix download URL when versions contain an '-' character
Browse files Browse the repository at this point in the history
Looks like the '-' are replaced with '~' prior to being uploaded to the Red Hat Developer Content Gateway
  • Loading branch information
rm3l committed Apr 27, 2022
1 parent 74da283 commit ee25ac1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ download_release() {
binaryExtension=""
fi

# Adapt the release URL convention for odo
url="https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/$TOOL_NAME/v${version}/$TOOL_NAME-${os_arch}${binaryExtension}"
# versions with a '-' need to be replaced with '~' in the download URL
local versionForDl=$(echo "$version" | tr '-' '~')
url="https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/$TOOL_NAME/v${versionForDl}/$TOOL_NAME-${os_arch}${binaryExtension}"

echo "* Downloading $TOOL_NAME release $version, for $os_arch..."
curl "${curl_opts[@]}" -o "$filename" -C - "$url" || fail "Could not download $url"
Expand Down

0 comments on commit ee25ac1

Please sign in to comment.