mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-10 14:40:32 +00:00
Fix jq handling on Windows
Fix regression introduced in unreleased 400052b460.
This commit is contained in:
6
main.sh
6
main.sh
@@ -604,7 +604,9 @@ case "${host_os}" in
|
|||||||
if ! type -P curl >/dev/null; then
|
if ! type -P curl >/dev/null; then
|
||||||
warn "install-action requires at least curl on Windows"
|
warn "install-action requires at least curl on Windows"
|
||||||
fi
|
fi
|
||||||
if type -P jq >/dev/null; then
|
if [[ -f "${install_action_dir}/jq/bin/jq.exe" ]]; then
|
||||||
|
jq() { "${install_action_dir}/jq/bin/jq.exe" -b "$@"; }
|
||||||
|
elif type -P jq >/dev/null; then
|
||||||
# https://github.com/jqlang/jq/issues/1854
|
# https://github.com/jqlang/jq/issues/1854
|
||||||
_tmp=$(jq -r .a <<<'{}')
|
_tmp=$(jq -r .a <<<'{}')
|
||||||
if [[ "${_tmp}" != "null" ]]; then
|
if [[ "${_tmp}" != "null" ]]; then
|
||||||
@@ -614,6 +616,7 @@ case "${host_os}" in
|
|||||||
else
|
else
|
||||||
jq() { command jq "$@" | tr -d '\r'; }
|
jq() { command jq "$@" | tr -d '\r'; }
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
printf '::group::Install packages required for installation (jq)\n'
|
printf '::group::Install packages required for installation (jq)\n'
|
||||||
mkdir -p -- "${install_action_dir}/jq/bin"
|
mkdir -p -- "${install_action_dir}/jq/bin"
|
||||||
@@ -627,7 +630,6 @@ case "${host_os}" in
|
|||||||
printf '::endgroup::\n'
|
printf '::endgroup::\n'
|
||||||
jq() { "${install_action_dir}/jq/bin/jq.exe" -b "$@"; }
|
jq() { "${install_action_dir}/jq/bin/jq.exe" -b "$@"; }
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
*) bail "unsupported host OS '${host_os}'" ;;
|
*) bail "unsupported host OS '${host_os}'" ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user