diff options
| author | Aiden Cline <[email protected]> | 2025-12-26 11:23:31 -0600 |
|---|---|---|
| committer | Aiden Cline <[email protected]> | 2025-12-26 11:28:18 -0600 |
| commit | 8416db03ef34a1ecf187faa81fb5ce7fe8ee4ec7 (patch) | |
| tree | 1549574eb7ab07d16511806b2b5eafccff82f9cd /install | |
| parent | d5b47d91282abbd61647ab67d62673ccccfdfb1a (diff) | |
| download | opencode-8416db03ef34a1ecf187faa81fb5ce7fe8ee4ec7.tar.gz opencode-8416db03ef34a1ecf187faa81fb5ce7fe8ee4ec7.zip | |
tweak: make install script handle 404s better
Diffstat (limited to 'install')
| -rwxr-xr-x | install | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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() { |
