tweak: make install script handle 404s better
This commit is contained in:
parent
d5b47d9128
commit
8416db03ef
1 changed files with 10 additions and 0 deletions
10
install
10
install
|
|
@ -155,8 +155,18 @@ if [ -z "$requested_version" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
# Strip leading 'v' if present
|
||||||
|
requested_version="${requested_version#v}"
|
||||||
url="https://github.com/sst/opencode/releases/download/v${requested_version}/$filename"
|
url="https://github.com/sst/opencode/releases/download/v${requested_version}/$filename"
|
||||||
specific_version=$requested_version
|
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
|
fi
|
||||||
|
|
||||||
print_message() {
|
print_message() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue