Skip to content

Commit f2f8bf8

Browse files
committed
Do not add package to description if it is already there
1 parent b5bdc64 commit f2f8bf8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

R/spell-check.R

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,12 @@ spell_check_test <- function(vignettes = TRUE, lang = "en_GB", error = FALSE){
164164

165165
add_to_description <- function(desc){
166166
lines <- readLines(desc, warn = FALSE)
167-
out <- if(!any(grepl("^Suggests", lines))){
168-
c(lines, "Suggests:\n spelling")
169-
} else {
170-
sub("^Suggests:", "Suggests:\n spelling,", lines)
167+
if(!any(grepl("spelling", lines))){
168+
out <- if(!any(grepl("^Suggests", lines))){
169+
c(lines, "Suggests:\n spelling")
170+
} else {
171+
sub("^Suggests:", "Suggests:\n spelling,", lines)
172+
}
173+
writeLines(out, desc)
171174
}
172-
writeLines(out, desc)
173175
}

0 commit comments

Comments
 (0)