summaryrefslogtreecommitdiff
path: root/tools/upgrade.sh
diff options
context:
space:
mode:
authorYannick Eckey <yannick.eckey@googlemail.com>2015-10-15 15:37:30 +0200
committerYannick Eckey <yannick.eckey@googlemail.com>2015-10-16 22:27:46 +0200
commit75e619b72421e7330011c8bda5f99af5231a8b7d (patch)
treeaa8a54393aefd2a502903bc8e0f0e361ff2cdec5 /tools/upgrade.sh
parent306e3e7ea0f2aef2ab9e3a51986c34f7296a3ab2 (diff)
downloadzsh-75e619b72421e7330011c8bda5f99af5231a8b7d.tar.gz
zsh-75e619b72421e7330011c8bda5f99af5231a8b7d.tar.bz2
zsh-75e619b72421e7330011c8bda5f99af5231a8b7d.zip
Fix install.sh/upgrade.sh for tput-less systems
@fcrozat's original fix assumes `which` not to output anything to STDOUT in case the command is not found. That is not necessarily true on all systems. A better solution is to check the return value instead. Fixes #4376
Diffstat (limited to 'tools/upgrade.sh')
-rw-r--r--tools/upgrade.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/upgrade.sh b/tools/upgrade.sh
index 6e9696202..fe8fbadca 100644
--- a/tools/upgrade.sh
+++ b/tools/upgrade.sh
@@ -1,8 +1,7 @@
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
-tput=$(which tput)
-if [ -n "$tput" ]; then
+if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then