Skip to content

Commit

Permalink
only check line after Contributors if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk committed Jul 17, 2024
1 parent 54d28a7 commit 2834c77
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions R/add-contributors.R
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,8 @@ add_contribs_to_one_file <- function (ctbs, orgrepo, ncols, format, filename) {
)
} else {
contribs_sec <- grep ("^\\#\\#\\sContributors$|^Contributors$", x)
if (x [contribs_sec + 1] == "^-+$") {
contribs_sec <- contribs_sec + 1
}
if (x [contribs_sec + 1] == "") {
if (length(x) > contribs_sec &&
x [contribs_sec + 1] %in% c("^-+$", "")) {
contribs_sec <- contribs_sec + 1
}
}
Expand Down

0 comments on commit 2834c77

Please sign in to comment.