summaryrefslogtreecommitdiffstats
path: root/bash
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-01-29 23:17:34 -0500
committerdoy <doy@tozt.net>2009-01-29 23:17:34 -0500
commit76ca4426f9bf1af166e32697259500118ed42295 (patch)
tree69c0aa404945b4c3fbbea4ee63a9fac57542e7ef /bash
parent13a664017423691d2b61af6be0ca462558f171fc (diff)
downloadconf-76ca4426f9bf1af166e32697259500118ed42295.tar.gz
conf-76ca4426f9bf1af166e32697259500118ed42295.zip
factor the tput test out into a function, to make it cleaner
Diffstat (limited to 'bash')
-rw-r--r--bash/colors7
1 files changed, 6 insertions, 1 deletions
diff --git a/bash/colors b/bash/colors
index 12e5a31..9360898 100644
--- a/bash/colors
+++ b/bash/colors
@@ -1,4 +1,9 @@
-if [[ -n "$(which tput)" && "$(__tmp=$(tput setf 0); echo $?)" == "0" ]]; then
+function test_tput {
+ local tmp
+ [[ -x "$(which tput)" ]] || return 1
+ tmp=$(tput setf 0)
+}
+if test_tput; then
GRAY=$(tput setf 8)
BLACK=$(tput setf 0)
RED=$(tput setf 4)