R/att_to_description.R
att_amend_desc.Rd
Amend package DESCRIPTION file with the list of dependencies extracted from
R, tests, vignettes files.
att_to_desc_from_pkg() is an alias of att_amend_desc(),
for the correspondence with att_to_desc_from_is()
.
att_amend_desc(
path = ".",
path.n = "NAMESPACE",
path.d = "DESCRIPTION",
dir.r = "R",
dir.v = "vignettes",
dir.t = "tests",
extra.suggests = NULL,
pkg_ignore = NULL,
document = TRUE,
normalize = TRUE,
inside_rmd = FALSE,
must.exist = TRUE,
check_if_suggests_is_installed = TRUE
)
att_to_desc_from_pkg(
path = ".",
path.n = "NAMESPACE",
path.d = "DESCRIPTION",
dir.r = "R",
dir.v = "vignettes",
dir.t = "tests",
extra.suggests = NULL,
pkg_ignore = NULL,
document = TRUE,
normalize = TRUE,
inside_rmd = FALSE,
must.exist = TRUE,
check_if_suggests_is_installed = TRUE
)
path to the root of the package directory. Default to current directory.
path to namespace file.
path to description file.
path to directory with R scripts.
path to vignettes directory. Set to empty (dir.v = "") to ignore.
path to tests directory. Set to empty (dir.t = "") to ignore.
vector of other packages that should be added in Suggests (pkgdown, covr for instance)
vector of packages names to ignore.
Run function roxygenise of roxygen2 package
Logical. Whether to normalize the DESCRIPTION file. See desc::desc_normalize()
Logical. Whether function is run inside a Rmd, in case this must be executed in an external R session
Logical. If TRUE then an error is given if packages do not exist within installed packages. If NA, a warning.
Logical. Whether to require that packages in the Suggests section are installed.
Update DESCRIPTION file.
tmpdir <- tempfile(pattern = "description")
dir.create(tmpdir)
file.copy(system.file("dummypackage",package = "attachment"), tmpdir,
recursive = TRUE)
#> [1] TRUE
dummypackage <- file.path(tmpdir, "dummypackage")
# browseURL(dummypackage)
att_amend_desc(path = tmpdir)
#> An new path.d =DESCRIPTION was added to the directory. Please fill it.
#> Next time, you may want to use 'usethis::use_description()'
#> First time using roxygen2. Upgrading automatically...
#> Setting `RoxygenNote` to "7.2.3"
#> ℹ Loading description1d484f1b2c47
#> Writing NAMESPACE
#> A new path.n =/tmp/RtmpJtncO6/description1d484f1b2c47/NAMESPACE was added to the directory.
#> Updating description1d484f1b2c47 documentation
#> ℹ Loading description1d484f1b2c47
#> ℹ Loading description1d484f1b2c47
# Clean after examples
unlink(tmpdir, recursive = TRUE)