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 ca444e4000)
This commit is contained in:
Ingo Karkat
2024-09-21 12:31:16 +02:00
parent c2b3d01024
commit b00c212fcc

View File

@@ -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" "$@"
;;