From f19ed92a9317407ef9ee60803bef052264d1d65c Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 10 Jan 2026 21:19:19 +0900 Subject: [PATCH] Workaround MSYS2 bash issue https://github.com/taiki-e/cache-cargo-install-action/commit/1d834de755a209a5e7824d47446f5b3839bc7199 --- main.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.sh b/main.sh index dfc3550e..157ac270 100755 --- a/main.sh +++ b/main.sh @@ -654,10 +654,10 @@ case "${host_os}" in jq() { "${install_action_dir}/jq/bin/jq.exe" -b "$@"; } elif type -P jq >/dev/null; then # https://github.com/jqlang/jq/issues/1854 - _tmp=$(jq -r .a <<<'{}') - if [[ "${_tmp}" != "null" ]]; then - _tmp=$(jq -b -r .a 2>/dev/null <<<'{}' || true) - if [[ "${_tmp}" == "null" ]]; then + _tmp=$(jq -r .a <<<'{}' | wc -c) + if [[ "${_tmp}" != 5 ]]; then + _tmp=$({ jq -b -r .a 2>/dev/null <<<'{}' || true; } | wc -c) + if [[ "${_tmp}" == 5 ]]; then jq() { command jq -b "$@"; } else jq() { command jq "$@" | tr -d '\r'; }