From 2555870c3174894e5bb287f0bf1506bbf6d24ddc Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Sun, 8 Jan 2023 05:21:00 +0530 Subject: [PATCH] Handle rate limits in installer --- install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index f971b57..9f0784c 100755 --- a/install.sh +++ b/install.sh @@ -91,10 +91,12 @@ download_zoxide() { wget) _releases="$(wget -qO- "$_releases_url")" || err "wget: failed to download $_releases_url" ;; esac + (echo "$_releases" | grep -q 'API rate limit exceeded') && + err "you have exceeded GitHub's API rate limit. Please try again later, or use a different installation method: https://github.com/ajeetdsouza/zoxide/#installation" local _package_url _package_url="$(echo "$_releases" | grep "browser_download_url" | cut -d '"' -f 4 | grep "$_arch")" || - err "zoxide has not yet been packaged for your architecture ($_arch), please file an issue at https://github.com/ajeetdsouza/zoxide/issues" + err "zoxide has not yet been packaged for your architecture ($_arch), please file an issue: https://github.com/ajeetdsouza/zoxide/issues" local _ext case "$_package_url" in