From d4d8d13ceb6087422ac8c41798e3ded5e63046fb Mon Sep 17 00:00:00 2001 From: liuhao Date: Sun, 10 May 2026 16:22:34 +0800 Subject: [PATCH] fix(install): add api.github.com fallback for version detection in install.sh --- scripts/install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index e241d34..74777a2 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -45,6 +45,10 @@ detect_arch() { get_latest_version() { latest_url="https://github.com/${REPO}/releases/latest" version=$(curl -sI "$latest_url" | grep -i "location:" | sed 's/.*\/tag\/\(.*\)/\1/' | tr -d '\r\n') + if [ -z "$version" ]; then + api_url="https://api.github.com/repos/${REPO}/releases/latest" + version=$(curl -fsSL "$api_url" -H "User-Agent: redmine-cli-installer" | sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p' | head -n 1) + fi if [ -z "$version" ]; then error "Failed to get latest version" fi