Skip to content

Commit

Permalink
lib/log: use builtin [[ for test evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelicWizard committed Sep 30, 2021
1 parent a3a2855 commit 1c84607
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/log.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ export BASH_IT_LOG_LEVEL_ALL=3
function _has_colors()
{
# Check that stdout is a terminal
test -t 1 || return 1
[[ -t 1 ]] || return 1

ncolors=$(tput colors)
test -n "$ncolors" && test "$ncolors" -ge 8 || return 1
local -i ncolors
ncolors="$(tput colors)"
[[ -n "$ncolors" && "$ncolors" -ge 8 ]] || return 1
return 0
}

Expand Down

0 comments on commit 1c84607

Please sign in to comment.