When using gs_rsync to upload a local source folder to a cloud destination folder, an empty local directory is created with the name of the cloud folder.
Reproducible Example
# local source data to upload
dir.create("tmp")
file.create("tmp/hello.txt")
# cloud destination
mybucket <- "gs://your-bucket-here"
gs_rsync("tmp", mybucket)
# now there is a nested local directory at gs:/<mybucket> !
utils::file_test("-d", mybucket)
Error Location
The error is coming from this line
if (!utils::file_test("-d", destination))
dir.create(destination, recursive = TRUE)
Proposed Solution
I believe a simple fix would be to test if the destination is a Google Storage URI.
if (!is_gs_uri(destination) & !utils::file_test("-d", destination)) {
dir.create(destination, recursive = TRUE)
}
I can submit a PR if needed. Thanks!
When using
gs_rsyncto upload a local source folder to a cloud destination folder, an empty local directory is created with the name of the cloud folder.Reproducible Example
Error Location
The error is coming from this line
Proposed Solution
I believe a simple fix would be to test if the destination is a Google Storage URI.
I can submit a PR if needed. Thanks!