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,17 +68,13 @@ do
echo "Skipping $t" echo "Skipping $t"
continue continue
fi fi
if $SILENT ; then
echo -e "Verifying $t" echo -e "Verifying $t"
if bash "$t" &> /dev/null; then if run-cmd bash "$t"; 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 fi
else
bash "$t" || ret=1
fi
done done
for t in `ls $KUBE_ROOT/hack/verify-*.py` for t in `ls $KUBE_ROOT/hack/verify-*.py`
@ -79,17 +83,13 @@ do
echo "Skipping $t" echo "Skipping $t"
continue continue
fi fi
if $SILENT ; then
echo -e "Verifying $t" echo -e "Verifying $t"
if python "$t" &> /dev/null; then if run-cmd python "$t"; 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 fi
else
python "$t" || ret=1
fi
done done
exit $ret exit $ret