lib: Move _has_colors to log module

pull/1628/head
Noah Gorny 2020-06-27 14:01:47 +03:00 committed by Noah Gorny
parent 5daecc9381
commit 8a3cf76307
2 changed files with 10 additions and 10 deletions

View File

@ -1,15 +1,5 @@
#!/usr/bin/env bash
function _has_colors()
{
# Check that stdout is a terminal
test -t 1 || return 1
ncolors=$(tput colors)
test -n "$ncolors" && test "$ncolors" -ge 8 || return 1
return 0
}
# colored ls
export LSCOLORS='Gxfxcxdxdxegedabagacad'

View File

@ -4,6 +4,16 @@ export BASH_IT_LOG_LEVEL_ERROR=1
export BASH_IT_LOG_LEVEL_WARNING=2
export BASH_IT_LOG_LEVEL_ALL=3
function _has_colors()
{
# Check that stdout is a terminal
test -t 1 || return 1
ncolors=$(tput colors)
test -n "$ncolors" && test "$ncolors" -ge 8 || return 1
return 0
}
function _log_general()
{
_about 'Internal function used for logging, uses BASH_IT_LOG_PREFIX as a prefix'