Skip to content

Commit 2e08b5f

Browse files
Gemini: Correct handling of error branch
FALSE || integer() gives NA; grep() was never right to use. I'm not sure if res could ever have length()>1, but doesn't hurt
1 parent 4ea5ab5 commit 2e08b5f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/R-CMD-check-occasional.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ jobs:
142142
dt_tar = list.files(pattern = "^data[.]table_.*[.]tar[.]gz$")
143143
if (!length(dt_tar)) stop("Built tar.gz not found among: ", toString(list.files()))
144144
res = system2(Rbin, c("CMD", "check", dt_tar[1L], check_args), stdout=TRUE, stderr=TRUE, env=sprintf("%s=%s", names(env), env))
145-
if (!is.null(attr(res, "status")) || is.na(res) || grep("^Status:.*(ERROR|WARNING)", res)) {
145+
if (!is.null(attr(res, "status")) || anyNA(res) || any(grepl("^Status:.*(ERROR|WARNING)", res))) {
146146
writeLines(as.character(res))
147147
stop("R CMD check failed")
148148
}

0 commit comments

Comments
 (0)