diff --git a/NEWS.md b/NEWS.md index 6172395..6faa451 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +- fix bug where `download_hydat()` fails if `tempdir()` is on a different device than `hydat_path` (@mpdavison, #192) + # tidyhydat 0.6.1 - Add `...` to print methods so you can pass arguments all the way down. - Add workaround for vroom#519 bug that prevents `realtime_*` functions from working diff --git a/R/download.R b/R/download.R index 90ecf32..d74d76c 100644 --- a/R/download.R +++ b/R/download.R @@ -121,9 +121,10 @@ download_hydat <- function(dl_hydat_here = NULL, ask = TRUE) { on.exit(unlink(tempdir, recursive = TRUE)) ## Move to final resting place and rename to consistent name - file.rename( + file.copy( list.files(tempdir, pattern = "\\.sqlite3$", full.names = TRUE), - hydat_path + hydat_path, + overwrite = TRUE )