Do not install jq if not affected by bugs, even on Windows

This commit is contained in:
Taiki Endo
2023-09-16 22:54:11 +09:00
parent af0cad7ea8
commit 13c0d6f598

26
main.sh
View File

@@ -493,16 +493,22 @@ case "${host_os}" in
case "${jq_version}" in case "${jq_version}" in
jq-1.[7-9]* | jq-1.[1-9][0-9]*) jq='' ;; 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)" _tmp=$(jq <<<"{}" -r .a || echo "")
mkdir -p "${install_action_dir}/jq/bin" if [[ "${_tmp}" == "null" ]]; then
url='https://github.com/jqlang/jq/releases/download/jq-1.7/jq-windows-amd64.exe' jq=''
checksum='2e9cc54d0a5d098e2007decec1dbb3c555ca2f5aabded7aec907fe0ffe401aab' jq_use_b=''
( else
cd "${install_action_dir}/jq/bin" info "old jq (${jq_version}) has bug on Windows; downloading jq 1.7 (will not be added to PATH)"
download_and_checksum "${url}" "${checksum}" mkdir -p "${install_action_dir}/jq/bin"
mv tmp jq.exe url='https://github.com/jqlang/jq/releases/download/jq-1.7/jq-windows-amd64.exe'
) checksum='2e9cc54d0a5d098e2007decec1dbb3c555ca2f5aabded7aec907fe0ffe401aab'
echo (
cd "${install_action_dir}/jq/bin"
download_and_checksum "${url}" "${checksum}"
mv tmp jq.exe
)
echo
fi
;; ;;
esac esac
fi fi