summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2019-06-01 19:26:17 +0200
committerMarc Cornellà <marc.cornella@live.com>2019-06-03 17:18:25 +0200
commit0824dcc9fbd66171f53c38c8327598ec469ebe85 (patch)
treea4ff19320f0d5f624971b251500951da99a09715 /tools
parent2e54ba2dfb95890c6ea32323ae14486ffc1c46ed (diff)
downloadzsh-0824dcc9fbd66171f53c38c8327598ec469ebe85.tar.gz
zsh-0824dcc9fbd66171f53c38c8327598ec469ebe85.tar.bz2
zsh-0824dcc9fbd66171f53c38c8327598ec469ebe85.zip
installer: allow for tput errors
tput may throw errors on invalid $TERM values, for example. This shorthand syntax allows for that as well as for if tput doesn't exist.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/install.sh6
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/install.sh b/tools/install.sh
index 15c7b7703..a515bac48 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -52,11 +52,7 @@ error() {
# Set up color sequences
setup_color() {
- if command_exists tput; then
- ncolors=$(tput colors)
- else
- ncolors=0
- fi
+ ncolors=$(tput colors 2>/dev/null) || ncolors=0
# Only use colors if connected to a terminal that supports them
if [ -t 1 ] && [ $ncolors -ge 8 ]; then