set_desc_url | R Documentation |
I frequently forget to add an URL to my packages'
‘DESCRIPTION’ files,
and when I do not, I often forget to check that the URL is valid,
respectively the one I want.
So this is a wrapper to functions from desc and gert and
messaging and/or adding
a reminder to file TODO.md
.
set_desc_url(
url,
path = ".",
normalize = TRUE,
overwrite = FALSE,
do_commit = is_force(),
do_remind = !isTRUE(getOption("packager")[["force"]]),
verbose = getOption("packager")[["verbose"]]
)
url |
A character string giving the URL to set or add in ‘DESCRIPTION’. |
path |
Path to the ‘DESCRIPTION’ file, see
|
normalize |
See |
overwrite |
Set (overwrite) the URL field in ‘DESCRIPTION’ instead adding the URL given to the URL field in ‘DESCRIPTION’? |
do_commit |
Commit the updated ‘DESCRIPTION’? |
do_remind |
Write a reminder into the package's ‘TODO.md’? |
verbose |
Be verbose? |
Invisibly TRUE
path <- file.path(tempdir(), "myPackage")
unlink(path, recursive = TRUE)
usethis::create_package(path, open = FALSE)
gert::git_init(path)
gert::git_add(repo = path, files = ".")
signature <- gert::git_signature(name = "Foobar", email = "no@where.com")
gert::git_commit(repo = path, message = "Initial commit",
author = signature, committer = signature)
url <- provide_gitlab_url(path = path)
set_desc_url(url, path = path)
grep("URL:", readLines(file.path(path, "DESCRIPTION")), value = TRUE)
readLines(file.path(path, "TODO.md"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.