From 21f255b011122fe0712e6d74141f2f814c21f3bc Mon Sep 17 00:00:00 2001 From: mpdavison Date: Fri, 27 Sep 2024 10:55:44 -0600 Subject: [PATCH 1/4] Fixes 192: Use file.copy for cross-disk flexibility in HYDAT download Replaced file.rename with file.copy to handle situations where the temp folder and the destination are on different physical disks (e.g. Docker container with different mount points for the tempdir and the destination). --- R/download.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/download.R b/R/download.R index 90ecf32..87eb2b5 100644 --- a/R/download.R +++ b/R/download.R @@ -121,7 +121,7 @@ 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 ) From 7d1686036cb21e21a19dd299287a683d0c97dc12 Mon Sep 17 00:00:00 2001 From: mpdavison Date: Sun, 29 Sep 2024 21:29:01 -0600 Subject: [PATCH 2/4] destination file should be be overwritten --- R/download.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/download.R b/R/download.R index 87eb2b5..d74d76c 100644 --- a/R/download.R +++ b/R/download.R @@ -123,7 +123,8 @@ download_hydat <- function(dl_hydat_here = NULL, ask = TRUE) { ## Move to final resting place and rename to consistent name file.copy( list.files(tempdir, pattern = "\\.sqlite3$", full.names = TRUE), - hydat_path + hydat_path, + overwrite = TRUE ) From 9f166173ed893ad922c3672b2c912fe047457c1b Mon Sep 17 00:00:00 2001 From: mpdavison Date: Tue, 1 Oct 2024 11:49:14 -0600 Subject: [PATCH 3/4] Update NEWS.md --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index 6172395..cbb34cb 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 From 2f8a93ac93a45bdbd6cc708de95475421eed0e33 Mon Sep 17 00:00:00 2001 From: mpdavison Date: Tue, 1 Oct 2024 11:53:59 -0600 Subject: [PATCH 4/4] Update NEWS.md added some backticks --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index cbb34cb..6faa451 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -- fix bug where download_hydat() fails if tempdir() is on a different device than hydat_path (@mpdavison, #192) +- 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.