Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support jq 1.7 #14

Merged
merged 1 commit into from
Jul 2, 2024
Merged

fix: support jq 1.7 #14

merged 1 commit into from
Jul 2, 2024

Conversation

bjyoungblood
Copy link
Collaborator

jq 1.7 doesn't like the unescaped newlines in the GitHub API response
(which includes release notes). Since none of these scripts use the
release notes, we can strip out all \r and \n characters.

Also added set -euo pipefail to lib/utils.bash and a test to bail
out early if no toolchains in the API response match the current os/arch.

Finally, uname -m is preferred to uname -p since the latter can
return unknown (which is the case on Alpine Linux running in Docker on
a Darwin aarch64 host). On that topic, previous toolchain releases for
Linux ARM hosts were sometimes labeled as arm and sometimes as
aarch64, so a pattern is now used to match those values.

At some point, it might make sense to go back to older releases and
hardcode their URLs since the filename formats have not always been 100%
consistent.

Fixes #13.

`jq` 1.7 doesn't like the unescaped newlines in the GitHub API response
(which includes release notes). Since none of these scripts use the
release notes, we can strip out all `\r` and `\n` characters.

Also added `set -euo pipefail` to `lib/utils.bash` and a test to bail
out early if no toolchains in the API response match the current os/arch.

Finally, `uname -m` is preferred to `uname -p` since the latter can
return `unknown` (which is the case on Alpine Linux running in Docker on
a Darwin aarch64 host). On that topic, previous toolchain releases for
Linux ARM hosts were sometimes labeled as `arm` and sometimes as
`aarch64`, so a pattern is now used to match those values.

At some point, it might make sense to go back to older releases and
hardcode their URLs since the filename formats have not always been 100%
consistent.

Fixes #13.
@lawik
Copy link

lawik commented Jul 2, 2024

Booooom! That did it ✨

Much appreciated

@bjyoungblood bjyoungblood merged commit 5c903bd into main Jul 2, 2024
5 checks passed
@bjyoungblood bjyoungblood deleted the strip-newlines-from-json branch July 2, 2024 16:21
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.

Does not work under jq 1.7 (default in Alpine)
2 participants