Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ sort_versions() {
fetch_all_assets() {
curl -s -H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${GH_REPO}/releases |
jq -r '.[0].assets[] | "\(.name) \(.browser_download_url)"'
jq -r '.assets[] | "\(.name) \(.browser_download_url)"'
}

validate_platform() {
Expand Down Expand Up @@ -114,9 +114,11 @@ download_release() {
validate_platform

# TODO: split output without piping to awk
url=$(fetch_all_assets |
grep "^${toolname}-${version}_${USE_PLATFORM}\s" |
awk '{print $2}')
url=$(fetch_all_assets | grep "^${toolname}-${version}_${USE_PLATFORM}\s" | awk '{print $2}')

if [ -z "$url" ]; then
fail "No release asset found for ${toolname} ${version} on ${USE_PLATFORM}. Check asset name and presence."
fi

(
cd "${ASDF_DOWNLOAD_PATH}" || exit 1
Expand Down
Loading