From b00c212fcc585e8927c0aa9e561935a6ca9fe586 Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Sat, 21 Sep 2024 12:31:16 +0200 Subject: [PATCH] FIX: Regression: Compatibility: Bash on MacOS 12 does not support ${var^^} (after ca444e4) This went undetected because the CI/CD pipeline was broken again due to an outdated MacOS image. Continue to use tr for uppercasing. Enable pipefail so that grep (which needs to happen before the uppercasing) result is still considered. (This corrects commit ca444e40009efc28f50c9a9002e07c4cc1668955) --- todo.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/todo.sh b/todo.sh index 7c43c1eb..026739a5 100755 --- a/todo.sh +++ b/todo.sh @@ -1346,8 +1346,8 @@ case $action in "listpri" | "lsp" ) shift ## was "listpri", new $1 is priority to list or first TERM - pri=$(printf "%s\n" "$1" | grep '^\([A-Za-z]\|[A-Za-z]-[A-Za-z]\|[A-Z][A-Z-]*[A-Z]\)$') && shift || pri="A-Z" - post_filter_command="${post_filter_command:-}${post_filter_command:+ | }grep '^ *[0-9]\+ ([${pri^^}]) '" + pri=$(set -o pipefail; printf "%s\n" "$1" | grep '^\([A-Za-z]\|[A-Za-z]-[A-Za-z]\|[A-Z][A-Z-]*[A-Z]\)$' | tr '[:lower:]' '[:upper:]') && shift || pri="A-Z" + post_filter_command="${post_filter_command:-}${post_filter_command:+ | }grep '^ *[0-9]\+ ([${pri}]) '" _list "$TODO_FILE" "$@" ;;