diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-10-20 15:52:45 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-10-20 15:52:45 -0400 |
commit | 60366e4583a1d148dd5f8171c9148ebb98890478 (patch) | |
tree | f0ab64b754339b6c20b2c17b5a1798e44009391f /tests/color.sh | |
parent | 962d715ce2dee7a017dacca3b787ade6d33cd1c6 (diff) | |
download | bfs-60366e4583a1d148dd5f8171c9148ebb98890478.tar.xz |
tests/color: Remove some useless cats
Diffstat (limited to 'tests/color.sh')
-rw-r--r-- | tests/color.sh | 12 |
1 files changed, 3 insertions, 9 deletions
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 -} |