diff --git a/github-release-install.sh b/github-release-install.sh index aa9243e..3d72665 100755 --- a/github-release-install.sh +++ b/github-release-install.sh @@ -47,14 +47,11 @@ API="https://api.github.com/repos/${ORG_PROJ}/releases/${RELTAG}" # retry up to 5 times with 5 second delays for any error included HTTP 404 etc curl --fail --retry 5 --retry-delay 5 --retry-all-errors -sL ${API} -o ${API_JSON} -RPM_URLS=$(cat ${API_JSON} \ +RPM_URLS=($(cat ${API_JSON} \ | jq \ -r \ --arg arch_filter "${ARCH_FILTER}" \ - '.assets | sort_by(.created_at) | reverse | .[] | select(.name|test($arch_filter)) | select (.name|test("rpm$")) | .browser_download_url') -for URL in ${RPM_URLS}; do - # WARNING: in case of multiple matches, this only installs the first matched release - echo "execute: rpm-ostree install \"${URL}\"" - rpm-ostree install "${URL}" - break -done + '.assets | sort_by(.created_at) | reverse | .[] | select(.name|test($arch_filter)) | select(.name|test("rpm$")) | .browser_download_url')) +# WARNING: in case of multiple matches, this only installs the first matched release +echo "execute: rpm-ostree install \"${RPM_URLS[0]}\"" +rpm-ostree install "${RPM_URLS[0]}"