From 8416db03ef34a1ecf187faa81fb5ce7fe8ee4ec7 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Fri, 26 Dec 2025 11:23:31 -0600 Subject: [PATCH] tweak: make install script handle 404s better --- install | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/install b/install index e89ca9fb70..702fb4a534 100755 --- a/install +++ b/install @@ -155,8 +155,18 @@ if [ -z "$requested_version" ]; then exit 1 fi else + # Strip leading 'v' if present + requested_version="${requested_version#v}" url="https://github.com/sst/opencode/releases/download/v${requested_version}/$filename" specific_version=$requested_version + + # Verify the release exists before downloading + http_status=$(curl -sI -o /dev/null -w "%{http_code}" "https://github.com/sst/opencode/releases/tag/v${requested_version}") + if [ "$http_status" = "404" ]; then + echo -e "${RED}Error: Release v${requested_version} not found${NC}" + echo -e "${MUTED}Available releases: https://github.com/sst/opencode/releases${NC}" + exit 1 + fi fi print_message() {