3b2d03630f557769c659e150eceabe54c89b545a

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #4377 from fcrozat/master

Do not fail if tput is not available

Diff

 1diff --git a/tools/install.sh b/tools/install.sh
 2index 4b1a6ba7e1651180159aaf73587f48d01a54b1e9..30d66d4b53b37a753dd6ea3f653c88e3553fb695 100755
 3--- a/tools/install.sh
 4+++ b/tools/install.sh
 5@@ -2,7 +2,10 @@ set -e
 6 
 7 # Use colors, but only if connected to a terminal, and that terminal
 8 # supports them.
 9-ncolors=$(tput colors)
10+tput=$(which tput)
11+if [ -n "$tput" ]; then
12+    ncolors=$($tput colors)
13+fi
14 if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
15   RED="$(tput setaf 1)"
16   GREEN="$(tput setaf 2)"
17diff --git a/tools/upgrade.sh b/tools/upgrade.sh
18index 65af6e36843d805621cd71d60275c2ff84692780..6e9696202b3e97350142987bd3fa0f78194ccb4a 100644
19--- a/tools/upgrade.sh
20+++ b/tools/upgrade.sh
21@@ -1,7 +1,10 @@
22 
23 # Use colors, but only if connected to a terminal, and that terminal
24 # supports them.
25-ncolors=$(tput colors)
26+tput=$(which tput)
27+if [ -n "$tput" ]; then
28+    ncolors=$(tput colors)
29+fi
30 if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
31   RED="$(tput setaf 1)"
32   GREEN="$(tput setaf 2)"