Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes 192: Use file.copy for cross-disk flexibility in HYDAT download #205

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions R/download.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
boshek marked this conversation as resolved.
Show resolved Hide resolved
list.files(tempdir, pattern = "\\.sqlite3$", full.names = TRUE),
hydat_path
hydat_path,
overwrite = TRUE
)


Expand Down
Loading