diff --git a/.ci/test-r-package.sh b/.ci/test-r-package.sh index 9525a9bf35ea..7d821676bb71 100755 --- a/.ci/test-r-package.sh +++ b/.ci/test-r-package.sh @@ -181,12 +181,11 @@ elif [[ $R_BUILD_TYPE == "cran" ]]; then # the exceptions below are from R itself and not LightGBM: # https://github.com/kalibera/rchk/issues/22#issuecomment-656036156 - exit $( - cat "${RCHK_LOG_FILE}" \ - | grep -v "in function strptime_internal" \ + exit "$( + grep "${RCHK_LOG_FILE}" -v "in function strptime_internal" \ | grep -v "in function RunGenCollect" \ | grep --count -E '\[PB\]|ERROR' - ) + )" fi # Test CRAN source .tar.gz in a directory that is not this repo or below it.