Skip to content

Commit

Permalink
Get correct syntax for allowing users to prevent onload messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwestgate committed Apr 12, 2024
1 parent 1d3ad82 commit cfaaba4
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions R/onload.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' Set-up for galah during loading
#' @noRd
#' @keywords Internal
#' @importFrom cli cli_text
#' @importFrom cli col_magenta
#' @importFrom glue glue
#' @importFrom potions brew
.onLoad <- function(libname, pkgname) {
if (pkgname == "galah") {
Expand All @@ -16,11 +16,15 @@
try(galah_version <- utils::packageDescription("galah")[["Version"]],
silent = TRUE)) ## get the galah version, if we can
bullets <- c(
cli::cli_text("galah: version {galah_version}"),
i = cli::cli_text("{cli::col_magenta('Default node set to ALA (ala.org.au).')}"),
i = cli::cli_text("{cli::col_magenta('See all supported GBIF nodes with `show_all(atlases)`.')}"),
i = cli::cli_text("{cli::col_magenta('To change nodes, use e.g. `galah_config(atlas = \"GBIF\")`.')}")
glue("galah: version {galah_version}"),
i = col_magenta('Default node set to ALA (ala.org.au).'),
i = col_magenta('See all supported GBIF nodes with `show_all(atlases)`.'),
i = col_magenta('To change nodes, use e.g. `galah_config(atlas = \"GBIF\")`.')
)
packageStartupMessage(bullets)
inform(bullets,
class = c("packageStartupMessage", # see ?packageStartupMessage (required by `check()`)
"simpleMessage",
"message",
"condition"))
}
}

0 comments on commit cfaaba4

Please sign in to comment.