functions: only enable colors on terminals

We dont want wolors enabled when output is a file or a pipe
This commit is contained in:
Natanael Copa 2014-04-30 13:53:17 +00:00
parent 62d0c7b832
commit e65307d6d1
1 changed files with 1 additions and 1 deletions

View File

@ -175,7 +175,7 @@ enable_colors() {
BLUE="\033[1;34m"
}
if [ -n "$USE_COLORS" ]; then
if [ -n "$USE_COLORS" ] && [ -t 1 ]; then
enable_colors
else
disable_colors