Skip to content

Commit

Permalink
setup_package() uses existing Language when set. Otherwise set it to …
Browse files Browse the repository at this point in the history
…en-GB.

fixes #137 as reported by @adamhsparks
  • Loading branch information
ThierryO committed Jul 12, 2024
1 parent e95f7b4 commit 72aa964
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion R/setup_package.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,16 @@ setup_package <- function(path = ".", license = c("GPL-3", "MIT")) {

# add checklist.yml
if (!file_exists(path(path, "checklist.yml"))) {
x <- checklist$new(x = path, language = "en-GB", package = TRUE)
if (descript$has_fields("Language")) {
x <- checklist$new(
x = path, language = descript$get_field("Language"), package = TRUE
)
} else {
x <- checklist$new(x = path, language = "en-GB", package = TRUE)
descript$set("Language", "en-GB")
path(x$get_path, "DESCRIPTION") |>
descript$write()

Check warning on line 46 in R/setup_package.R

View check run for this annotation

Codecov / codecov/patch

R/setup_package.R#L43-L46

Added lines #L43 - L46 were not covered by tests
}
x$set_required()
x$set_ignore(c(".github", "LICENSE.md"))
write_checklist(x)
Expand Down

0 comments on commit 72aa964

Please sign in to comment.