From 8f2c8e2cf6171a05fb6104923e4f49a68f34fe7b Mon Sep 17 00:00:00 2001 From: Koichi Nakashima Date: Sat, 20 Jun 2020 21:18:45 +0900 Subject: [PATCH] Workaround for ksh 2020 --- lib/core/matchers/satisfy.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/core/matchers/satisfy.sh b/lib/core/matchers/satisfy.sh index 945e4480..57f4f78b 100644 --- a/lib/core/matchers/satisfy.sh +++ b/lib/core/matchers/satisfy.sh @@ -14,15 +14,16 @@ shellspec_matcher_satisfy() { # shellcheck disable=SC2034 IFS=" $IFS" && SHELLSPEC_EXPECT="$*" && IFS=${IFS#?} - ( if shellspec_is_identifier "$1"; then + shellspec_puts "${SHELLSPEC_SUBJECT:-}" | ( + if shellspec_is_identifier "$1"; then if [ "${SHELLSPEC_SUBJECT+x}" ]; then eval "$1=\$SHELLSPEC_SUBJECT" else unset "$1" ||: fi fi - shellspec_puts "${SHELLSPEC_SUBJECT:-}" | "$@" >&4 - ) 2>"$SHELLSPEC_SATISFY_STDERR_FILE" &&: + "$@" + ) 2>"$SHELLSPEC_SATISFY_STDERR_FILE" >&4 &&: set -- "$?" if [ -s "$SHELLSPEC_SATISFY_STDERR_FILE" ]; then