R/ghe_host.R

Defines functions ghe_host

Documented in ghe_host

#' Retrieve GH Enterprise Location
#'
#' @export

ghe_host <- function() {
  host <- getOption("ghe_host") %||% Sys.getenv("GHE_HOST")
  host <- switch(host != "", host)

  # check if GHE Host location has been set ------------------------------------
  if (is.null(host)) {
    cli::cli_alert_danger(
      paste("GHE Host is not specified in {.code options(ghe_host=)}",
            "or the {.code ghe_host} envorinmental variable.",
            "Set the v, and try again.")
    )
  }

  host
}
ddsjoberg/ghe.utils documentation built on Dec. 19, 2021, 10:04 p.m.