-
Notifications
You must be signed in to change notification settings - Fork 20
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
download_hydat() fails to update local hydat copy #180
Comments
Yeah I can see the issue. I think a good fix would be to simply ensure that the directory is empty before downloading and then spit out a good error message that you need to move or delete the existing file. Prior to this we always simply overwrote the previous HYDAT. I think this is still right and that we don't want to preserve old versions of HYDAT on someone's computer but I was to raise that here as well. To unblock you can of course simply empty the directory in |
…atabase. (#181) * Fix file.rename issue with download_hydat, rejig messages and user prompts. * database file size is fetched from the URL and shown in the user prompt. * Update R/download.R Co-authored-by: Sam Albers <[email protected]> * Update R/download.R Co-authored-by: Sam Albers <[email protected]> Co-authored-by: Sam Albers <[email protected]>
Working with a dated local version of hydat and version 0.5.6 of tidyhydat downloaded from CRAN OR from GitHub:
Downloading works if starting with an empty download directory (...Local/tidyhydat/tidyhydat) but fails again once Hydat.sqlite3 is created again:
After failure, two files appear in the download directory where there should be one:
The issue evidently stems from lines 112:116 of download.R:
'from' is of length 2 (owing to the two files with .sqlite3 extension) while 'to' is of length one.
This stems from the line above,
utils::unzip(tmp, exdir = dl_hydat_here, overwrite = TRUE))
, which creates a second file (the new database).If I get time I'll fix the issue and submit a pull request in the next day or two!
The text was updated successfully, but these errors were encountered: