From 60366e4583a1d148dd5f8171c9148ebb98890478 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 20 Oct 2023 15:52:45 -0400 Subject: tests/color: Remove some useless cats --- tests/color.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'tests/color.sh') diff --git a/tests/color.sh b/tests/color.sh index 0d6ef68..805d2b8 100644 --- a/tests/color.sh +++ b/tests/color.sh @@ -24,20 +24,14 @@ color_fd() { color_fd 1 && COLOR_STDOUT=1 || COLOR_STDOUT=0 color_fd 2 && COLOR_STDERR=1 || COLOR_STDERR=0 -# Save these in case the tests unset PATH -CAT=$(command -v cat) +# Save this in case the tests unset PATH SED=$(command -v sed) # Filter out escape sequences if necessary color() { if color_fd 1; then - "$CAT" + "$@" else - "$SED" $'s/\e\\[[^m]*m//g' + "$@" | "$SED" $'s/\e\\[[^m]*m//g' fi } - -# printf with auto-detected color support -cprintf() { - printf "$@" | color -} -- cgit v1.2.3