USAID-OHA-SI / grabr

OHA/SI APIs package
https://usaid-oha-si.github.io/grabr/
Other
1 stars 2 forks source link

lazy_secrets - service must be a non-empty string #15

Closed baboyma closed 1 year ago

baboyma commented 1 year ago

Select default service option when no value is passed

baboyma commented 1 year ago

Running this: grabr::lazy_secrets() throws an error:

Error: service must be a non-empty string (length 1 character) or NULL
achafetz commented 1 year ago

My suggestion is that if no service is provided, we default to the first, datim

service <- service[1]

Alternative, we just change the default to just datim and provide a check - service %in% c("datim", "pano", "s3")

baboyma commented 1 year ago

Yes, these will work. match.arg() will also do the trick.

greet <- function(name = c("John", "Christine", "Charles")) {

  n <- match.arg(name)

  paste0("Hello ", n, "!")
}

greet()

greet("Christine")
achafetz commented 1 year ago

Need to require a input