ci: no-exit: Skip check if no files to check

If we find no files to check, gracefully quit the test.
Formerly, if the list was empty we ended up trying to read
from stdin, and thus hung.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
This commit is contained in:
Graham Whaley 2018-07-10 15:02:06 +01:00
parent 1c453a372e
commit 6268ba4aa3

View File

@ -22,6 +22,8 @@ for f in $candidates; do
files="$f $files"
done
[ -z "$files" ] && echo "No files to check, skipping" && exit 0
if egrep -n '\<os\.Exit\>' $files; then
echo "Direct calls to os.Exit() are forbidden, please use exit() so atexit() works"
exit 1