Skip to content

Commit cc66138

Browse files
committed
update script
1 parent f61766d commit cc66138

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

scripts/install.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,20 @@ mkdir -p "$INSTALL_DIR"
6868

6969
# Determine version and download URL
7070
if [ -z "$requested_version" ]; then
71-
if ! specific_version=$(curl -s https://api.github.com/repos/devcontainer-community/feature-installer/releases/latest | awk -F'"' '/"tag_name": "/ {gsub(/^v/, "", $4); print $4}') || [[ -z "$specific_version" ]]; then
72-
echo -e "${RED}Failed to fetch version information${NC}"
71+
print_message info "Fetching latest version information..."
72+
api_response=$(curl -s https://api.github.com/repos/devcontainer-community/feature-installer/releases/latest)
73+
if [[ $? -ne 0 ]] || [[ -z "$api_response" ]]; then
74+
print_message error "Failed to fetch release information from GitHub API"
7375
exit 1
7476
fi
77+
78+
specific_version=$(echo "$api_response" | awk -F'"' '/"tag_name": "/ {gsub(/^v/, "", $4); print $4}')
79+
if [[ -z "$specific_version" ]]; then
80+
print_message error "Failed to parse version information from API response"
81+
exit 1
82+
fi
83+
84+
print_message info "Latest version found: ${YELLOW}$specific_version"
7585
url="https://github.com/devcontainer-community/feature-installer/releases/download/v${specific_version}/$filename"
7686
else
7787
specific_version=$requested_version

0 commit comments

Comments
 (0)