From d6eff3b3a31192b3c37e03ebff278cbc8ace2023 Mon Sep 17 00:00:00 2001 From: CodinCat Date: Tue, 15 Jul 2025 09:13:12 +0900 Subject: improve error handling and logging for GitHub API failures in upgrade and install script (#972) --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'install') diff --git a/install b/install index e18bd7bbf..2a48cc1f4 100755 --- a/install +++ b/install @@ -48,7 +48,7 @@ if [ -z "$requested_version" ]; then url="https://github.com/sst/opencode/releases/latest/download/$filename" specific_version=$(curl -s https://api.github.com/repos/sst/opencode/releases/latest | awk -F'"' '/"tag_name": "/ {gsub(/^v/, "", $4); print $4}') - if [[ $? -ne 0 ]]; then + if [[ $? -ne 0 || -z "$specific_version" ]]; then echo "${RED}Failed to fetch version information${NC}" exit 1 fi -- cgit v1.2.3