Skip to content

Commit

Permalink
check_license() overwrites wrong LICENSE.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ThierryO committed Jul 17, 2024
1 parent 368b6cf commit 87acb14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions R/check_description.R
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ Please send a pull request if you need support for this license.",
official <- official[-3]
current <- current[-3]
}
problems <- c(
problems,
"LICENSE.md doesn't match the version in the checklist package"[
(length(current) != length(official)) || any(current != official)
]
if ((length(current) != length(official)) || any(current != official)) {
problems <- c(
problems, "LICENSE.md doesn't match the version in the checklist package"

Check warning on line 278 in R/check_description.R

View check run for this annotation

Codecov / codecov/patch

R/check_description.R#L277-L278

Added lines #L277 - L278 were not covered by tests
)
set_license(x)

Check warning on line 280 in R/check_description.R

View check run for this annotation

Codecov / codecov/patch

R/check_description.R#L280

Added line #L280 was not covered by tests
}
x$add_error(
errors = problems,
item = "license", keep = FALSE
Expand Down
4 changes: 2 additions & 2 deletions R/set_license.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set_license <- function(x = ".") {
)
) |>
system.file(package = "checklist") |>
file_copy(license_file)
file_copy(license_file, overwrite = TRUE)
if (!grepl("^MIT", this_desc$get_field("License"))) {
return(invisible(NULL))
}
Expand All @@ -46,6 +46,6 @@ set_license <- function(x = ".") {
}
path("generic_template", "cc_by_4_0.md") |>
system.file(package = "checklist") |>
file_copy(license_file)
file_copy(license_file, overwrite = TRUE)
return(invisible(NULL))
}

0 comments on commit 87acb14

Please sign in to comment.