Skip to content
Open
Show file tree
Hide file tree
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
15 changes: 13 additions & 2 deletions bin/install-latest-linux.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
#!/usr/bin/env bash
set -eo pipefail

# Install the latest version of the Linux binary
DOWNLOAD_URL="$(curl -s https://api.github.com/repos/brevdev/brev-cli/releases/latest | grep "browser_download_url.*linux.*amd64" | cut -d '"' -f 4)"
# Fetch release metadata from GitHub API
API_RESPONSE="$(curl -sf https://api.github.com/repos/brevdev/brev-cli/releases/latest 2>&1)" || {
echo "Error: Failed to fetch release info from GitHub API." >&2
echo "This may be caused by rate limiting. Try again later or set a GITHUB_TOKEN." >&2
Copy link
Copy Markdown
Contributor

@patelspratik patelspratik Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does setting a GITHUB_TOKEN work? we don't utilize it anywhere, right? Wouldn't the curl need to conditionally check for it?

Also, since the people who see this the most are likely on a VPN:

echo "Error: Failed to fetch release info from GitHub API." >&2
echo "This is often caused by rate limiting when many requests come from the same IP." >&2
echo "If you are using a VPN, try turning it off and running this script again." >&2
echo "For more details, see: https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting" >&2

exit 1
}

# Extract the download URL for linux/amd64
DOWNLOAD_URL="$(echo "${API_RESPONSE}" | grep "browser_download_url.*linux.*amd64" | cut -d '"' -f 4)"
if [ -z "${DOWNLOAD_URL}" ]; then
echo "Error: Could not find release for linux amd64" >&2
exit 1
fi

# Create temporary directory and ensure cleanup
TMP_DIR="$(mktemp -d)"
Expand Down
11 changes: 8 additions & 3 deletions bin/install-latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ case "${ARCH}" in
aarch64) ARCH="arm64" ;;
esac

# Get the appropriate download URL for this platform
DOWNLOAD_URL="$(curl -s https://api.github.com/repos/brevdev/brev-cli/releases/latest | grep "browser_download_url.*${OS}.*${ARCH}" | cut -d '"' -f 4)"
# Fetch release metadata from GitHub API
API_RESPONSE="$(curl -sf https://api.github.com/repos/brevdev/brev-cli/releases/latest 2>&1)" || {
echo "Error: Failed to fetch release info from GitHub API." >&2
echo "This may be caused by rate limiting. Try again later or set a GITHUB_TOKEN." >&2
exit 1
}

# Verify we found a suitable release
# Extract the download URL for this platform
DOWNLOAD_URL="$(echo "${API_RESPONSE}" | grep "browser_download_url.*${OS}.*${ARCH}" | cut -d '"' -f 4)"
if [ -z "${DOWNLOAD_URL}" ]; then
echo "Error: Could not find release for ${OS} ${ARCH}" >&2
exit 1
Expand Down
Loading