R/utils.R

Defines functions validate_glossary_cache_path

#' @importFrom rlang is_scalar_character
validate_glossary_cache_path <- function(path) {

  if (!rlang::is_scalar_character(path)) {
    stop("invalid format for cache path provided.", call. = FALSE)
  }

  if (!dir.exists(path)) {
    stop(
      "path: ",
      sQuote(path),
      " doesn't exist. Please create it first.",
      call. = FALSE
    )
  }

  path

}
carpentries/glosario-r documentation built on April 25, 2023, 8:48 p.m.