From e225d07e509a8a21fce7ab98555c82eafa19d12e Mon Sep 17 00:00:00 2001 From: jsta Date: Wed, 27 Jan 2021 16:12:44 -0500 Subject: [PATCH] fix 7z unpacking errors, allow correct force_unzip ops --- R/get.R | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/R/get.R b/R/get.R index b25c6aa..5a09b8c 100644 --- a/R/get.R +++ b/R/get.R @@ -92,16 +92,15 @@ nhd_plus_get <- function(vpu = NA, component = "NHDSnapshot", force_dl = FALSE, if(!has_7z()$yes){ stop("The 7-zip program is needed to unpack NHD downloads (http://www.7-zip.org/).") } - system(paste0(has_7z()$path, " e ", shQuote(destfile), - " -o", shQuote(destsubdir))) + system(paste0(has_7z()$path, " e -y ", shQuote(normalizePath(destfile)), + " -o", shQuote(normalizePath(destsubdir)))) }else{ if(get_if_not_exists(url, destfile, force_dl = force_dl)){ if(!has_7z()$yes){ stop("The 7-zip program is needed to unpack NHD downloads (http://www.7-zip.org/).") } - system(paste0(has_7z()$path, " e ", shQuote(destfile), - " -o", shQuote(destsubdir))) + system(paste0(has_7z()$path, " e ", shQuote(normalizePath(destfile)), + " -o", shQuote(normalizePath(destsubdir)))) } } } -