Skip to content

Conversation

@eandersons
Copy link

@eandersons eandersons commented Jan 8, 2025

The function fetch_latest_version was updated to correctly retrieve the architecture specific download URL from a release info response.

It appears that the previous solution was based on the assumption that each URL in the response JSON would be in its own line, but for now the whole response is in a single line. My proposed solution works for both single-line and multi-line JSON response.

It should be noted that the regular expression [[:alnum:]:/.-]\+ used with sed will cause the script to fail in case the download URLs will contain some other characters than digits, letters, colon (:), slash (/), dot (.) and hyphen (-).
Probably a better alternative would be to use the regular expression [^\"]\+ to match every character except double quotes (") which are unlikely to be used for download URLs.
A bit simpler and more reliable solution would be to use jq (for example: jq .linux_x64), but that unfortunately would also be an additional dependency since not all systems have jq installed by default.

@eandersons eandersons marked this pull request as draft January 8, 2025 14:02
@eandersons eandersons force-pushed the Fix-Linux-download-URL-retrieval branch from 58c4a5f to 2181da8 Compare January 8, 2025 14:03
@eandersons eandersons marked this pull request as ready for review January 8, 2025 14:06
@eandersons eandersons marked this pull request as draft January 8, 2025 14:07
@eandersons eandersons force-pushed the Fix-Linux-download-URL-retrieval branch from 2181da8 to c16cff0 Compare January 8, 2025 14:08
@eandersons eandersons marked this pull request as ready for review January 8, 2025 14:09
The function `fetch_latest_version` was updated to correctly retrieve
the architecture specific download URL from a release info response.
@eandersons eandersons force-pushed the Fix-Linux-download-URL-retrieval branch from c16cff0 to 81b031d Compare January 10, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant