aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2016-02-29 18:45:40 +0100
committerJohannes Schickel2016-02-29 19:10:10 +0100
commit01a76df6e3b1ffd95b6a0febfb77bd6003f9441a (patch)
tree7d5ac367f7bbcdb906002280d7888d062910e191
parenta375cbf42b0ceb89bc01ab701b476975c94f58df (diff)
downloadscummvm-rg350-01a76df6e3b1ffd95b6a0febfb77bd6003f9441a.tar.gz
scummvm-rg350-01a76df6e3b1ffd95b6a0febfb77bd6003f9441a.tar.bz2
scummvm-rg350-01a76df6e3b1ffd95b6a0febfb77bd6003f9441a.zip
OPENPANDORA: Don't output colors in pnd_make.sh when redirecting output to file.
-rwxr-xr-xdists/openpandora/pnd_make.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/dists/openpandora/pnd_make.sh b/dists/openpandora/pnd_make.sh
index 202f137acc..f077c42d0e 100755
--- a/dists/openpandora/pnd_make.sh
+++ b/dists/openpandora/pnd_make.sh
@@ -42,14 +42,14 @@ cecho () # Color-echo. Argument $1 = message, Argument $2 = color
local default_msg="No message passed." # Doesn't really need to be a local variable.
message=${1:-$default_msg} # Defaults to default message.
- # We only output colors when a TERM environment variable is set. This
- # fixes execution of the script on buildbot, which does not have this set.
- if [ -z "$TERM" ]; then
- echo "$message"
- else
+ # We only output colors when stdout is outputting to a terminal.
+ # This avoids color codes being output in log files created on buildbot.
+ if [ -t 1 ]; then
color=${2:-$black} # Defaults to black, if not specified.
echo -e "$color$message"
tput sgr0 # Reset to normal.
+ else
+ echo "$message"
fi
return
}