R/package.R

Defines functions load_pkg_description

load_pkg_description <- function(path) {

  path <- normalizePath(path, mustWork = TRUE)

  if (!is_dir(path)) {
    dir <- tempfile()
    path_desc <- untar_description(path, dir = dir)
    on.exit(unlink(dir, recursive = TRUE))

  } else {
    path_desc <- file.path(path, "DESCRIPTION")
  }

  desc <- read_dcf(path_desc)
  names(desc) <- tolower(names(desc))
  desc$path <- path

  desc
}
MangoTheCat/install documentation built on April 7, 2024, 2:56 a.m.