Skip to content

Commit

Permalink
Do not install jq if not affected by bugs, even on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Sep 16, 2023
1 parent af0cad7 commit 13c0d6f
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -493,16 +493,22 @@ case "${host_os}" in
case "${jq_version}" in
jq-1.[7-9]* | jq-1.[1-9][0-9]*) jq='' ;;
*)
info "old jq (${jq_version}) has bug on Windows; downloading jq 1.7 (will not be added to PATH)"
mkdir -p "${install_action_dir}/jq/bin"
url='https://github.com/jqlang/jq/releases/download/jq-1.7/jq-windows-amd64.exe'
checksum='2e9cc54d0a5d098e2007decec1dbb3c555ca2f5aabded7aec907fe0ffe401aab'
(
cd "${install_action_dir}/jq/bin"
download_and_checksum "${url}" "${checksum}"
mv tmp jq.exe
)
echo
_tmp=$(jq <<<"{}" -r .a || echo "")
if [[ "${_tmp}" == "null" ]]; then
jq=''
jq_use_b=''
else
info "old jq (${jq_version}) has bug on Windows; downloading jq 1.7 (will not be added to PATH)"
mkdir -p "${install_action_dir}/jq/bin"
url='https://github.com/jqlang/jq/releases/download/jq-1.7/jq-windows-amd64.exe'
checksum='2e9cc54d0a5d098e2007decec1dbb3c555ca2f5aabded7aec907fe0ffe401aab'
(
cd "${install_action_dir}/jq/bin"
download_and_checksum "${url}" "${checksum}"
mv tmp jq.exe
)
echo
fi
;;
esac
fi
Expand Down

0 comments on commit 13c0d6f

Please sign in to comment.