Skip to content

Commit

Permalink
fix: Script install.sh in dumb TERM
Browse files Browse the repository at this point in the history
When $TERM is dumb the number of colours returned is -1 we end up with no values set for the colours.
  • Loading branch information
FabioAntunes committed Apr 17, 2024
1 parent 25eb8a3 commit 35927e8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ check_binaries() {

# Check if we have colors available, it looks good
check_colors(){
GREEN=''
RED=''
YELLOW=''
NOCOL=''
if command -v tput > /dev/null; then
COLORS="$(tput colors)"
if [ -n "${COLORS}" ] && [ "${COLORS}" -ge 8 ]; then
Expand All @@ -34,11 +38,6 @@ check_colors(){
YELLOW="$(tput setaf 3)"
NOCOL="$(tput sgr0)"
fi
else
GREEN=''
RED=''
YELLOW=''
NOCOL=''
fi
}

Expand Down

0 comments on commit 35927e8

Please sign in to comment.