mirror of
https://github.com/kdabir/has.git
synced 2024-11-10 21:26:50 +01:00
Merge pull request #9 from dexterous/master
Update reporter; colourize output
This commit is contained in:
commit
055457d499
@ -1,12 +1,20 @@
|
||||
OK=0
|
||||
KO=0
|
||||
|
||||
PASS='✔'
|
||||
FAIL='✘'
|
||||
|
||||
if [[ $TERM == xterm-*color ]]; then
|
||||
PASS="\E[32m$PASS\E[0m"
|
||||
FAIL="\E[31m$FAIL\E[0m"
|
||||
fi
|
||||
|
||||
_dq_report () {
|
||||
if [ "$2" -eq 0 ]; then
|
||||
echo "✔ $1"
|
||||
echo -e "$PASS $1"
|
||||
OK=$(($OK+1))
|
||||
else
|
||||
echo "✘ $1"
|
||||
echo -e "$FAIL $1"
|
||||
KO=$(($KO+1))
|
||||
fi
|
||||
}
|
||||
@ -127,6 +135,6 @@ _dq_report 'yeoman' $?
|
||||
zsh --version > /dev/null 2>&1
|
||||
_dq_report 'zsh' $?
|
||||
|
||||
echo Your dq is $OK / $(($OK+$KO))
|
||||
echo; echo Your dq is $OK / $(($OK+$KO))
|
||||
|
||||
exit $KO
|
||||
|
@ -1,12 +1,20 @@
|
||||
OK=0
|
||||
KO=0
|
||||
|
||||
PASS='✔'
|
||||
FAIL='✘'
|
||||
|
||||
if [[ $TERM == xterm-*color ]]; then
|
||||
PASS="\E[32m$PASS\E[0m"
|
||||
FAIL="\E[31m$FAIL\E[0m"
|
||||
fi
|
||||
|
||||
_dq_report () {
|
||||
if [ "$2" -eq 0 ]; then
|
||||
echo "✔ $1"
|
||||
echo -e "$PASS $1"
|
||||
OK=$(($OK+1))
|
||||
else
|
||||
echo "✘ $1"
|
||||
echo -e "$FAIL $1"
|
||||
KO=$(($KO+1))
|
||||
fi
|
||||
}
|
||||
@ -21,6 +29,6 @@ _dq_report 'java' $?
|
||||
|
||||
lein -v > /dev/null 2>&1
|
||||
_dq_report 'leiningen' $?
|
||||
echo Your dq is $OK / $(($OK+$KO))
|
||||
echo; echo Your dq is $OK / $(($OK+$KO))
|
||||
|
||||
exit $KO
|
||||
|
@ -1,12 +1,20 @@
|
||||
OK=0
|
||||
KO=0
|
||||
|
||||
PASS='✔'
|
||||
FAIL='✘'
|
||||
|
||||
if [[ $TERM == xterm-*color ]]; then
|
||||
PASS="\E[32m$PASS\E[0m"
|
||||
FAIL="\E[31m$FAIL\E[0m"
|
||||
fi
|
||||
|
||||
_dq_report () {
|
||||
if [ "$2" -eq 0 ]; then
|
||||
echo "✔ $1"
|
||||
echo -e "$PASS $1"
|
||||
OK=$(($OK+1))
|
||||
else
|
||||
echo "✘ $1"
|
||||
echo -e "$FAIL $1"
|
||||
KO=$(($KO+1))
|
||||
fi
|
||||
}
|
||||
@ -33,6 +41,6 @@ _dq_report 'ruby' $?
|
||||
|
||||
vi --version > /dev/null 2>&1
|
||||
_dq_report 'vi' $?
|
||||
echo Your dq is $OK / $(($OK+$KO))
|
||||
echo; echo Your dq is $OK / $(($OK+$KO))
|
||||
|
||||
exit $KO
|
||||
|
14
bin/db/dq.sh
14
bin/db/dq.sh
@ -1,12 +1,20 @@
|
||||
OK=0
|
||||
KO=0
|
||||
|
||||
PASS='✔'
|
||||
FAIL='✘'
|
||||
|
||||
if [[ $TERM == xterm-*color ]]; then
|
||||
PASS="\E[32m$PASS\E[0m"
|
||||
FAIL="\E[31m$FAIL\E[0m"
|
||||
fi
|
||||
|
||||
_dq_report () {
|
||||
if [ "$2" -eq 0 ]; then
|
||||
echo "✔ $1"
|
||||
echo -e "$PASS $1"
|
||||
OK=$(($OK+1))
|
||||
else
|
||||
echo "✘ $1"
|
||||
echo -e "$FAIL $1"
|
||||
KO=$(($KO+1))
|
||||
fi
|
||||
}
|
||||
@ -23,6 +31,6 @@ _dq_report 'mysql client' $?
|
||||
psql --version > /dev/null 2>&1
|
||||
_dq_report 'postgres client' $?
|
||||
|
||||
echo Your dq is $OK / $(($OK+$KO))
|
||||
echo; echo Your dq is $OK / $(($OK+$KO))
|
||||
|
||||
exit $KO
|
||||
|
@ -1,12 +1,20 @@
|
||||
OK=0
|
||||
KO=0
|
||||
|
||||
PASS='✔'
|
||||
FAIL='✘'
|
||||
|
||||
if [[ $TERM == xterm-*color ]]; then
|
||||
PASS="\E[32m$PASS\E[0m"
|
||||
FAIL="\E[31m$FAIL\E[0m"
|
||||
fi
|
||||
|
||||
_dq_report () {
|
||||
if [ "$2" -eq 0 ]; then
|
||||
echo "✔ $1"
|
||||
echo -e "$PASS $1"
|
||||
OK=$(($OK+1))
|
||||
else
|
||||
echo "✘ $1"
|
||||
echo -e "$FAIL $1"
|
||||
KO=$(($KO+1))
|
||||
fi
|
||||
}
|
||||
@ -46,6 +54,6 @@ _dq_report 'vi' $?
|
||||
yo --version > /dev/null 2>&1
|
||||
_dq_report 'yeoman' $?
|
||||
|
||||
echo Your dq is $OK / $(($OK+$KO))
|
||||
echo; echo Your dq is $OK / $(($OK+$KO))
|
||||
|
||||
exit $KO
|
||||
|
@ -1,12 +1,20 @@
|
||||
OK=0
|
||||
KO=0
|
||||
|
||||
PASS='✔'
|
||||
FAIL='✘'
|
||||
|
||||
if [[ $TERM == xterm-*color ]]; then
|
||||
PASS="\E[32m$PASS\E[0m"
|
||||
FAIL="\E[31m$FAIL\E[0m"
|
||||
fi
|
||||
|
||||
_dq_report () {
|
||||
if [ "$2" -eq 0 ]; then
|
||||
echo "✔ $1"
|
||||
echo -e "$PASS $1"
|
||||
OK=$(($OK+1))
|
||||
else
|
||||
echo "✘ $1"
|
||||
echo -e "$FAIL $1"
|
||||
KO=$(($KO+1))
|
||||
fi
|
||||
}
|
||||
@ -22,6 +30,6 @@ _dq_report 'java' $?
|
||||
|
||||
lazybones --version > /dev/null 2>&1
|
||||
_dq_report 'lazybones' $?
|
||||
echo Your dq is $OK / $(($OK+$KO))
|
||||
echo; echo Your dq is $OK / $(($OK+$KO))
|
||||
|
||||
exit $KO
|
||||
|
@ -1,12 +1,20 @@
|
||||
OK=0
|
||||
KO=0
|
||||
|
||||
PASS='✔'
|
||||
FAIL='✘'
|
||||
|
||||
if [[ $TERM == xterm-*color ]]; then
|
||||
PASS="\E[32m$PASS\E[0m"
|
||||
FAIL="\E[31m$FAIL\E[0m"
|
||||
fi
|
||||
|
||||
_dq_report () {
|
||||
if [ "$2" -eq 0 ]; then
|
||||
echo "✔ $1"
|
||||
echo -e "$PASS $1"
|
||||
OK=$(($OK+1))
|
||||
else
|
||||
echo "✘ $1"
|
||||
echo -e "$FAIL $1"
|
||||
KO=$(($KO+1))
|
||||
fi
|
||||
}
|
||||
@ -25,6 +33,6 @@ _dq_report 'javac' $?
|
||||
|
||||
mvn -v > /dev/null 2>&1
|
||||
_dq_report 'maven' $?
|
||||
echo Your dq is $OK / $(($OK+$KO))
|
||||
echo; echo Your dq is $OK / $(($OK+$KO))
|
||||
|
||||
exit $KO
|
||||
|
@ -1,12 +1,20 @@
|
||||
OK=0
|
||||
KO=0
|
||||
|
||||
PASS='✔'
|
||||
FAIL='✘'
|
||||
|
||||
if [[ $TERM == xterm-*color ]]; then
|
||||
PASS="\E[32m$PASS\E[0m"
|
||||
FAIL="\E[31m$FAIL\E[0m"
|
||||
fi
|
||||
|
||||
_dq_report () {
|
||||
if [ "$2" -eq 0 ]; then
|
||||
echo "✔ $1"
|
||||
echo -e "$PASS $1"
|
||||
OK=$(($OK+1))
|
||||
else
|
||||
echo "✘ $1"
|
||||
echo -e "$FAIL $1"
|
||||
KO=$(($KO+1))
|
||||
fi
|
||||
}
|
||||
@ -26,6 +34,6 @@ _dq_report 'ruby' $?
|
||||
rvm -v > /dev/null 2>&1
|
||||
_dq_report 'rvm' $?
|
||||
|
||||
echo Your dq is $OK / $(($OK+$KO))
|
||||
echo; echo Your dq is $OK / $(($OK+$KO))
|
||||
|
||||
exit $KO
|
||||
|
@ -1,12 +1,20 @@
|
||||
OK=0
|
||||
KO=0
|
||||
|
||||
PASS='✔'
|
||||
FAIL='✘'
|
||||
|
||||
if [[ $TERM == xterm-*color ]]; then
|
||||
PASS="\E[32m$PASS\E[0m"
|
||||
FAIL="\E[31m$FAIL\E[0m"
|
||||
fi
|
||||
|
||||
_dq_report () {
|
||||
if [ "$2" -eq 0 ]; then
|
||||
echo "✔ $1"
|
||||
echo -e "$PASS $1"
|
||||
OK=$(($OK+1))
|
||||
else
|
||||
echo "✘ $1"
|
||||
echo -e "$FAIL $1"
|
||||
KO=$(($KO+1))
|
||||
fi
|
||||
}
|
||||
@ -32,6 +40,6 @@ _dq_report 'scala' $STATUS
|
||||
scalac -version > /dev/null 2>&1
|
||||
_dq_report 'scalac' $?
|
||||
|
||||
echo Your dq is $OK / $(($OK+$KO))
|
||||
echo; echo Your dq is $OK / $(($OK+$KO))
|
||||
|
||||
exit $KO
|
||||
|
@ -1,12 +1,20 @@
|
||||
OK=0
|
||||
KO=0
|
||||
|
||||
PASS='✔'
|
||||
FAIL='✘'
|
||||
|
||||
if [[ $TERM == xterm-*color ]]; then
|
||||
PASS="\E[32m$PASS\E[0m"
|
||||
FAIL="\E[31m$FAIL\E[0m"
|
||||
fi
|
||||
|
||||
_dq_report () {
|
||||
if [ "$2" -eq 0 ]; then
|
||||
echo "✔ $1"
|
||||
echo -e "$PASS $1"
|
||||
OK=$(($OK+1))
|
||||
else
|
||||
echo "✘ $1"
|
||||
echo -e "$FAIL $1"
|
||||
KO=$(($KO+1))
|
||||
fi
|
||||
}
|
||||
@ -26,6 +34,6 @@ _dq_report 'wget' $?
|
||||
zsh --version > /dev/null 2>&1
|
||||
_dq_report 'zsh' $?
|
||||
|
||||
echo Your dq is $OK / $(($OK+$KO))
|
||||
echo; echo Your dq is $OK / $(($OK+$KO))
|
||||
|
||||
exit $KO
|
||||
|
@ -1,3 +1,3 @@
|
||||
echo Your dq is $OK / $(($OK+$KO))
|
||||
echo; echo Your dq is $OK / $(($OK+$KO))
|
||||
|
||||
exit $KO
|
||||
|
@ -1,12 +1,20 @@
|
||||
OK=0
|
||||
KO=0
|
||||
|
||||
PASS='✔'
|
||||
FAIL='✘'
|
||||
|
||||
if [[ $TERM == xterm-*color ]]; then
|
||||
PASS="\E[32m$PASS\E[0m"
|
||||
FAIL="\E[31m$FAIL\E[0m"
|
||||
fi
|
||||
|
||||
_dq_report () {
|
||||
if [ "$2" -eq 0 ]; then
|
||||
echo "✔ $1"
|
||||
echo -e "$PASS $1"
|
||||
OK=$(($OK+1))
|
||||
else
|
||||
echo "✘ $1"
|
||||
echo -e "$FAIL $1"
|
||||
KO=$(($KO+1))
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user