Skip to content

Commit

Permalink
fix 7z unpacking errors, allow correct force_unzip ops
Browse files Browse the repository at this point in the history
  • Loading branch information
jsta committed Jan 27, 2021
1 parent c19c001 commit e225d07
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions R/get.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
}
}
}

0 comments on commit e225d07

Please sign in to comment.