forked from loafle/openapi-generator-original
Improve 'bin/run-all-petstore' (#133)
This commit is contained in:
parent
3f81378d72
commit
9040f49311
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash
|
||||||
# this bash script will loop through all the .sh files under bin
|
# this bash script will loop through all the .sh files under bin
|
||||||
# execute the script and check the result (exit code) to see if
|
# execute the script and check the result (exit code) to see if
|
||||||
# there's any error
|
# there's any error
|
||||||
@ -8,17 +8,26 @@ echo "Please press CTRL+C to stop or the script will continue in 10 seconds."
|
|||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
for SCRIPT in `ls -l ./bin/*.sh | grep -v all`
|
successes=0
|
||||||
|
failures=0
|
||||||
|
for SCRIPT in $(ls -l ./bin/*.sh | grep -v all)
|
||||||
do
|
do
|
||||||
if [ -f $SCRIPT -a -x $SCRIPT ]
|
if [ -f ${SCRIPT} -a -x ${SCRIPT} ]; then
|
||||||
then
|
|
||||||
echo "Running $SCRIPT"
|
echo "Running $SCRIPT"
|
||||||
$SCRIPT
|
${SCRIPT}
|
||||||
rc=$?
|
rc=$?
|
||||||
if [[ $rc != 0 ]]
|
if [[ ${rc} != 0 ]]; then
|
||||||
then
|
>&2 echo "ERROR!! FAILED TO RUN ${SCRIPT}"
|
||||||
echo "ERROR!! FAILED TO RUN $SCRIPT"
|
((failures+=1))
|
||||||
exit $rc;
|
else
|
||||||
|
((successes+=1))
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if (( failures > 0 )); then
|
||||||
|
>&2 echo "[ERROR] ${failures} out of $((failures+successes)) scripts failed."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "[SUCCESS] ${successes} generators finished."
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user