From 169033c58a66112964dd1f90116ac6c0958c986c Mon Sep 17 00:00:00 2001 From: Felipe Date: Sun, 21 Mar 2021 03:00:45 +0000 Subject: [PATCH 1/2] fix assets_download extensions name bug (closes #27) --- R/assets_download.R | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/R/assets_download.R b/R/assets_download.R index 8e9962e1..811a37ca 100644 --- a/R/assets_download.R +++ b/R/assets_download.R @@ -43,8 +43,12 @@ #' the link of the item pointing to the directory where the assets were saved. #' #' @export -assets_download <- function(items, assets_name, output_dir = ".", - overwrite = FALSE, items_max = Inf, progress = TRUE, +assets_download <- function(items, + assets_name, + output_dir = ".", + overwrite = FALSE, + items_max = Inf, + progress = TRUE, ...) { #check the object subclass @@ -95,8 +99,9 @@ assets_download <- function(items, assets_name, output_dir = ".", utils::setTxtProgressBar(pb, i) items$features[[i]] <- .item_download(items$features[[i]], - assets_name, output_dir, - overwrite,...) + assets_name, + output_dir, + overwrite, ...) } # close progress bar if (progress) @@ -173,6 +178,9 @@ assets_download <- function(items, assets_name, output_dir = ".", #' @noRd .file_ext <- function(asset_url) { + # remove query string from url + asset_url[[1]] <- sub("\\?.+", "", asset_url[[1]]) + pos <- regexpr("\\.([[:alnum:]]+)$", asset_url[[1]]) if (pos < 0) return("") return(substring(asset_url[[1]], pos + 1)) From 7c5aa8c89c2cc6ca2cdfe0452a1c1ffa7c7eaa19 Mon Sep 17 00:00:00 2001 From: Felipe Date: Sun, 21 Mar 2021 03:09:46 +0000 Subject: [PATCH 2/2] update .drone.yml file --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 0c7048e6..063c57db 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,7 +6,7 @@ steps: image: brazildatacube/r-webservices:1.0.0 commands: - R CMD build . - - set -e; R CMD check *.tar.gz >&1 | tee stdfile && cat stdfile | (grep -E "(WARNING)" > /dev/null) && exit 1 || exit 0 + - set -e; R CMD check *.tar.gz >&1 | tee stdfile && cat stdfile | (grep -E "(WARNING|ERROR)" > /dev/null) && exit 1 || exit 0 - name: coverage image: brazildatacube/r-webservices:1.0.0