ThinkR-open / attachment

Tools to deal with dependencies in scripts, Rmd and packages
https://thinkr-open.github.io/attachment/
Other
108 stars 13 forks source link

Add option to check missing or not #41

Closed statnmap closed 2 years ago

statnmap commented 2 years ago

missing_packages breaks workflows with bookdown in CI (in particular if you use gitlabr::use_gitlab_ci() bookdown CI templates: https://github.com/statnmap/gitlabr/tree/main/inst/gitlab-ci):

The package pagedown is missing or more probably misspelled.
Please correct your typo or install it.

The line below should work because it was added to list dependencies necessary to build the bookdown and then used to install missing packages from remotes::install_local(). Hence, missing package is expected there.

imports <- unique(c("bookdown", "knitr", "pagedown", attachment::att_from_rmds(".", recursive = FALSE)));
attachment::att_to_desc_from_is(path.d = "DESCRIPTION", imports = imports)

There should be an option to warn instead of stop, although that would also mean that potentially we add bad package name in the list in DESCRIPTION. But we will see it at install.

Then, I will add a error_missing = TRUE by default.