R/set_remotes.R
set_remotes_to_desc.Rd
Add Remotes field to DESCRIPTION based on your local installation
set_remotes_to_desc(path.d = "DESCRIPTION", stop.local = FALSE, clean = TRUE)
path to description file.
Logical. Whether to stop if package was installed from local source. Message otherwise.
Logical. Whether to clean all existing remotes before run.
Used for side effect. Adds Remotes field in DESCRIPTION file.
tmpdir <- tempfile(pattern = "setremotes")
dir.create(tmpdir)
file.copy(system.file("dummypackage", package = "attachment"), tmpdir,
recursive = TRUE)
#> [1] TRUE
dummypackage <- file.path(tmpdir, "dummypackage")
# Add remotes field if there are Remotes locally
att_amend_desc(dummypackage) %>%
set_remotes_to_desc()
#> Updating dummypackage documentation
#> ────────────────────────────────────────────────────────────────────────────────
#> Changes in roxygen2 7.0.0:
#> * `%` is now escaped automatically in Markdown mode.
#> Please carefully check .Rd files for changes
#> ────────────────────────────────────────────────────────────────────────────────
#> Setting `RoxygenNote` to "7.2.3"
#> ℹ Loading dummypackage
#> Writing NAMESPACE
#> Writing NAMESPACE
#> ℹ Loading dummypackage
#> Package(s) Rcpp is(are) in category 'LinkingTo'. Check your Description file to be sure it is really what you want.
#> [-] 1 package(s) removed: utils.
#> [+] 2 package(s) added: stats, glue.
#> There are no remote packages installed on your computer to add to description
#> NULL
# Clean temp files after this example
unlink(tmpdir, recursive = TRUE)
if (FALSE) {
# For your current package
att_amend_desc() %>%
set_remotes_to_desc()
}