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.
Diff
1diff --git a/tools/install.sh b/tools/install.sh
2index 15c7b770310230a465a824478fbc56e026b8cf8e..a515bac485f102f0f84c42aea23bd346b7cbf1bb 100755
3--- a/tools/install.sh
4+++ b/tools/install.sh
5@@ -52,11 +52,7 @@ error() {
6 7 # Set up color sequences
8 setup_color() {
9- if command_exists tput; then
10- ncolors=$(tput colors)
11- else
12- ncolors=0
13- fi
14+ ncolors=$(tput colors 2>/dev/null) || ncolors=0
1516 # Only use colors if connected to a terminal that supports them
17 if [ -t 1 ] && [ $ncolors -ge 8 ]; then