R/bootstrap_desc.R

Defines functions desc_get_author desc_get_field desc_get_deps desc_get_version desc_get desc_description check_desc_installed

# All the fns here check that {desc} is installed
# before doing anything.
check_desc_installed <- function() {
  rlang::check_installed(
    "desc",
    reason = "to fill DESCRIPTION."
  )
}

desc_description <- function(file) {
  check_desc_installed()
  desc::description$new(
    file = file
  )
}

desc_get <- function(keys) {
  check_desc_installed()
  desc::desc_get(keys)
}

desc_get_version <- function() {
  check_desc_installed()
  desc::desc_get_version()
}

desc_get_deps <- function(file = NULL) {
  check_desc_installed()
  desc::desc_get_deps(file)
}

desc_get_field <- function(key) {
  check_desc_installed()
  desc::desc_get_field(key)
}

desc_get_author <- function() {
  check_desc_installed()
  desc::desc_get_author()
}

Try the golem package in your browser

Any scripts or data that you put into this service are public.

golem documentation built on Sept. 11, 2024, 7:54 p.m.