Skip to content

Commit

Permalink
fix: add knitr to website deps for use_article if not already in desc…
Browse files Browse the repository at this point in the history
…ription
  • Loading branch information
m-muecke committed Apr 13, 2024
1 parent 9e64daf commit 73929f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions R/vignette.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ use_article <- function(name, title = name) {
check_is_package("use_article()")

deps <- proj_deps()
if (!"knitr" %in% deps$package) {
proj_desc_field_update("Config/Needs/website", "knitr", append = TRUE)
}
if (!"rmarkdown" %in% deps$package) {
proj_desc_field_update("Config/Needs/website", "rmarkdown", append = TRUE)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-vignette.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test_that("use_article() adds rmarkdown to Config/Needs/website", {

expect_setequal(
proj_desc()$get_list("Config/Needs/website"),
c("rmarkdown", "somepackage")
c("knitr", "rmarkdown", "somepackage")
)
})

Expand Down

0 comments on commit 73929f5

Please sign in to comment.