From 6268ba4aa3ade9e195accdaf23e9ec84d493b8ff Mon Sep 17 00:00:00 2001 From: Graham Whaley Date: Tue, 10 Jul 2018 15:02:06 +0100 Subject: [PATCH] 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 --- .ci/go-no-os-exit.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.ci/go-no-os-exit.sh b/.ci/go-no-os-exit.sh index fe3bbf64a..efac2835a 100755 --- a/.ci/go-no-os-exit.sh +++ b/.ci/go-no-os-exit.sh @@ -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 '\' $files; then echo "Direct calls to os.Exit() are forbidden, please use exit() so atexit() works" exit 1