From cfaaba4fc7e8c1b2aa5eb1b8f0492fa29c2462ba Mon Sep 17 00:00:00 2001 From: Martin Westgate Date: Fri, 12 Apr 2024 11:48:20 +1000 Subject: [PATCH] Get correct syntax for allowing users to prevent onload messages --- R/onload.R | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/R/onload.R b/R/onload.R index 68a78ac1..03003fe9 100644 --- a/R/onload.R +++ b/R/onload.R @@ -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") { @@ -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")) } }