In verify-all.sh, print check and its status in verbose mode

This commit is contained in:
Jeff Grafton 2015-09-25 13:21:03 -07:00
parent 44b0bb1ae7
commit d466c63f5c

View File

@ -35,6 +35,14 @@ function is-excluded {
return 1 return 1
} }
function run-cmd() {
if ${SILENT}; then
"$@" &> /dev/null
else
"$@"
fi
}
while getopts ":v" opt; do while getopts ":v" opt; do
case $opt in case $opt in
v) v)
@ -60,16 +68,12 @@ do
echo "Skipping $t" echo "Skipping $t"
continue continue
fi fi
if $SILENT ; then echo -e "Verifying $t"
echo -e "Verifying $t" if run-cmd bash "$t"; then
if bash "$t" &> /dev/null; then echo -e "${color_green}SUCCESS${color_norm}"
echo -e "${color_green}SUCCESS${color_norm}"
else
echo -e "${color_red}FAILED${color_norm}"
ret=1
fi
else else
bash "$t" || ret=1 echo -e "${color_red}FAILED${color_norm}"
ret=1
fi fi
done done
@ -79,16 +83,12 @@ do
echo "Skipping $t" echo "Skipping $t"
continue continue
fi fi
if $SILENT ; then echo -e "Verifying $t"
echo -e "Verifying $t" if run-cmd python "$t"; then
if python "$t" &> /dev/null; then echo -e "${color_green}SUCCESS${color_norm}"
echo -e "${color_green}SUCCESS${color_norm}" else
else echo -e "${color_red}FAILED${color_norm}"
echo -e "${color_red}FAILED${color_norm}" ret=1
ret=1
fi
else
python "$t" || ret=1
fi fi
done done
exit $ret exit $ret