Skip to content

Commit 65712fa

Browse files
Copilotpelikhan
andcommitted
Fix: Redirect logging to stderr in fetch_release_data
The logging from print_info/print_warning/print_error was going to stdout and mixing with the JSON response, breaking jq parsing. Now all logging in fetch_release_data is explicitly redirected to stderr with >&2. Fixes the "jq: parse error: Invalid numeric literal" issue. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 8283f8c commit 65712fa

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

install-gh-aw.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ fetch_release_data() {
131131
curl_args+=("-H" "Authorization: Bearer $GH_TOKEN")
132132
fi
133133

134-
print_info "Fetching release data (attempt $attempt/$max_retries)..."
134+
print_info "Fetching release data (attempt $attempt/$max_retries)..." >&2
135135

136136
# Make the API call
137137
local response
@@ -146,20 +146,20 @@ fetch_release_data() {
146146

147147
# If this was the first attempt with auth and it failed, try without auth
148148
if [ "$attempt" -eq 1 ] && [ "$use_auth" = true ]; then
149-
print_warning "API call with GH_TOKEN failed. Retrying without authentication..."
150-
print_warning "Your GH_TOKEN may be incompatible (typically SSO) with this request."
149+
print_warning "API call with GH_TOKEN failed. Retrying without authentication..." >&2
150+
print_warning "Your GH_TOKEN may be incompatible (typically SSO) with this request." >&2
151151
use_auth=false
152152
# Don't count this as a retry attempt, just switch auth mode
153153
continue
154154
fi
155155

156156
# If we haven't exhausted retries, wait and try again
157157
if [ "$attempt" -lt "$max_retries" ]; then
158-
print_warning "Fetch attempt $attempt failed (exit code: $exit_code). Retrying in ${retry_delay}s..."
158+
print_warning "Fetch attempt $attempt failed (exit code: $exit_code). Retrying in ${retry_delay}s..." >&2
159159
sleep $retry_delay
160160
retry_delay=$((retry_delay * 2))
161161
else
162-
print_error "Failed to fetch release data after $max_retries attempts"
162+
print_error "Failed to fetch release data after $max_retries attempts" >&2
163163
fi
164164
done
165165

0 commit comments

Comments
 (0)