action_error "API returned an empty body, did we hit the query limit?"
exit 1
elif [ -z "$urls" ]; then
action_error "Couldn't find any URL in the returned body, did we hit the query limit? Body follows:"
cat "$payload"
exit 1
else
action_error "Couldn't find a proper URL for your architecture ($arch), looked for pattern '$pattern'. You may have to compile $PROGRAM_NAME yourself!"
action_detail "Maybe the release asset naming pattern has changed and we're not aware, if you think one of the packages below match your OS & arch, you may download & install them manually:"
for line in $urls; do
action_detail "$line"
done
exit 1
fi
url="$(echo "$urls" | grep -E "$pattern" | head -n1)"
if [ -n "$url" ]; then
# success
action_detail "$url"
return 0
elif [ ! -s "$payload" ]; then
action_error "API returned an empty body, did we hit the query limit?"
if [ "$CI" = "true" ]; then
action_detail "... CI environment detected, try $try out of $maxtries, sleeping and retrying..."
sleep 63
continue
fi
exit 1
elif [ -z "$urls" ]; then
action_error "Couldn't find any URL in the returned body, did we hit the query limit? Body follows:"
cat "$payload"
exit 1
else
action_error "Couldn't find a proper URL for your architecture ($arch), looked for pattern '$pattern'. You may have to compile $PROGRAM_NAME yourself!"
action_detail "Maybe the release asset naming pattern has changed and we're not aware, if you think one of the packages below match your OS & arch, you may download & install them manually:"