Commit 0824dcc9 authored by Marc Cornellà's avatar Marc Cornellà
Browse files

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.
parent 2e54ba2d
...@@ -52,11 +52,7 @@ error() { ...@@ -52,11 +52,7 @@ error() {
# Set up color sequences # Set up color sequences
setup_color() { setup_color() {
if command_exists tput; then ncolors=$(tput colors 2>/dev/null) || ncolors=0
ncolors=$(tput colors)
else
ncolors=0
fi
# Only use colors if connected to a terminal that supports them # Only use colors if connected to a terminal that supports them
if [ -t 1 ] && [ $ncolors -ge 8 ]; then if [ -t 1 ] && [ $ncolors -ge 8 ]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment