From f85004b84c16efef36455298bb053607fb4b68bb Mon Sep 17 00:00:00 2001 From: Peter Goodspeed-Niklaus Date: Tue, 21 Jan 2025 17:28:53 +0100 Subject: [PATCH] fix: emit output when bailing out Turns out that shellcheck was right, and my bash-fu was weak. This now properly emits output to stderr instead of a file named `2`. Also it now uses `printf` instead of `echo` so that things like `\n` work. --- scripts/merge-pr.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/merge-pr.sh b/scripts/merge-pr.sh index e545251352..5b8416fde6 100755 --- a/scripts/merge-pr.sh +++ b/scripts/merge-pr.sh @@ -14,9 +14,7 @@ set -e -o pipefail function bail() { msg="$1" if [ -n "$msg" ]; then - # we do want to emit to stderr here - #shellcheck disable=SC2210 - echo >2 "$msg" + >&2 printf "%s\n" "$msg" fi exit 1 }