summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Martins <bgcngm@gmail.com>2021-06-21 14:47:40 +0100
committerBruno Martins <bgcngm@gmail.com>2021-08-23 11:20:39 +0200
commiteed0c8ca3b84eef0cd53989f6e94c3098c530d37 (patch)
tree87d5f3fb87f6c887ab60944aaecf4cdb67986dc5
parentf12ce8b81d584b435813b6db8401a41bd91a64d0 (diff)
extract_utils: Skip colored echo when piped
Change-Id: I8a03a36f3fa022e6858cc5c1dbca8b8037efed03
-rw-r--r--extract_utils.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/extract_utils.sh b/extract_utils.sh
index de62732..7d2785f 100644
--- a/extract_utils.sh
+++ b/extract_utils.sh
@@ -1800,7 +1800,7 @@ function colored_echo() {
white|*) color=7 ;; # white or invalid color
esac
fi
- tput setaf $color
+ if [ -t 1 ] ; then tput setaf $color; fi
printf '%s\n' "$*"
- tput sgr0
+ if [ -t 1 ] ; then tput sgr0; fi
}