Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
ci: no-exit: Skip check if no files to check
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Graham Whaley authored and Eric Ernst committed Aug 23, 2018
1 parent e640655 commit 1b23e15
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .ci/go-no-os-exit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1b23e15

Please sign in to comment.