Skip to content

Commit 158a6aa

Browse files
committed
fix cli installer
1 parent 38e73a1 commit 158a6aa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

hindsight-docs/static/get-cli

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,15 @@ download_binary() {
106106
print_info "Downloading Hindsight CLI ${version} for $platform..." >&2
107107

108108
if command -v curl > /dev/null 2>&1; then
109-
curl -fsSL "$download_url" -o "$tmp_file"
109+
# GitHub returns 302 redirect to Azure blob storage
110+
# curl -L sometimes fails with 503, so manually handle redirect
111+
local redirect_url=$(curl -sI "$download_url" 2>/dev/null | grep -i "^location:" | sed 's/location: //i' | tr -d '\r\n')
112+
if [[ -n "$redirect_url" ]]; then
113+
curl -fsSL "$redirect_url" -o "$tmp_file"
114+
else
115+
# Fallback to direct download if no redirect
116+
curl -fsSL "$download_url" -o "$tmp_file"
117+
fi
110118
elif command -v wget > /dev/null 2>&1; then
111119
wget -q "$download_url" -O "$tmp_file"
112120
else

0 commit comments

Comments
 (0)