bcgov / rems

An R package to access data from British Columbia's Environmental Monitoring System
Apache License 2.0
19 stars 5 forks source link

In `get_ems_data()` can `ask` apply to all interactions #67

Closed steffilazerte closed 2 years ago

steffilazerte commented 2 years ago

I'm trying to use get_ems_data() without user interaction, but when when I use ask = FALSE, I'm still asked if I want to update 2yr data data interactively.

> library(rems)
> d <- get_ems_data(which = "2yr", ask = FALSE)
Your version of 2yr is dated 2021-08-24 03:40:00 and there is a newer version available. Would you like to download it? (y/n)

> get_ems_data(which = "2yr", check_only = TRUE, ask = FALSE)
Your version of 2yr is dated 2021-08-24 03:40:00 and there is a newer version available. Would you like to download it? (y/n)

Would it be possible for ask = FALSE to imply yes to updating? Right now the only options I can see are to a) force = TRUE or b) use an internal function (get_file_metadata()) to check the cache against the metadata (which I'd prefer to avoid).

Or would you know of an alternative approach I may have missed?

ateucher commented 2 years ago

I think that's reasonable