From 0824dcc9fbd66171f53c38c8327598ec469ebe85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 1 Jun 2019 19:26:17 +0200 Subject: [PATCH] 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. --- tools/install.sh | 6 +----- 1 file changed, 1 insertion(+), 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