lib: Move _has_colors to log module

This commit is contained in:
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'