mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
return a meaningful message if we hit the rate-limiter of GitHub
This commit is contained in:
@@ -102,7 +102,14 @@ elif [[ "$OSTYPE" == darwin* ]]; then
|
||||
opsys=darwin
|
||||
fi
|
||||
|
||||
RELEASE_URL=$(curl -s $release_url |\
|
||||
releases=$(curl -s $release_url)
|
||||
|
||||
if [[ $releases == *"API rate limit exceeded"* ]]; then
|
||||
echo "Github rate-limiter failed the request. Either authenticate or wait a couple of minutes."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RELEASE_URL=$(echo "${releases}" |\
|
||||
grep browser_download.*${opsys}_${arch} |\
|
||||
cut -d '"' -f 4 |\
|
||||
sort -V | tail -n 1)
|
||||
|
||||
Reference in New Issue
Block a user