Add Remotes field to DESCRIPTION based on your local installation

set_remotes_to_desc(path.d = "DESCRIPTION", stop.local = FALSE, clean = TRUE)

Arguments

path.d

path to description file.

stop.local

Logical. Whether to stop if package was installed from local source. Message otherwise.

clean

Logical. Whether to clean all existing remotes before run.

Value

Used for side effect. Adds Remotes field in DESCRIPTION file.

Examples

tmpdir <- tempdir()
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
#> Updating roxygen version in /tmp/RtmpiRQtPw/dummypackage/DESCRIPTION
#>  Loading dummypackage
#> Writing NAMESPACE
#> Writing NAMESPACE
#> 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
if (FALSE) {
# For your current package
att_amend_desc() %>%
  set_remotes_to_desc()
}