Skip to content

Commit

Permalink
#31 change filename alter in case of slash
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Sep 2, 2020
1 parent fb7a018 commit 59ca8e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/ZenodoRecord.R
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ ZenodoRecord <- R6Class("ZenodoRecord",

#download_file util
download_file <- function(file){
file$filename <- gsub("/", "_", file$filename)
file$filename <- substring(file$filename, regexpr("/", file$filename)+1, nchar(file$filename))
if (!quiet) cat(sprintf("[zen4R][INFO] Downloading file '%s' - size: %s\n",
file$filename, human_filesize(file$filesize)))
target_file <-file.path(path, file$filename)
Expand All @@ -1171,7 +1171,7 @@ ZenodoRecord <- R6Class("ZenodoRecord",
}
#check_integrity util
check_integrity <- function(file){
file$filename <- gsub("/", "_", file$filename)
file$filename <- substring(file$filename, regexpr("/", file$filename)+1, nchar(file$filename))
target_file <-file.path(path, file$filename)
#check md5sum
target_file_md5sum <- tools::md5sum(target_file)
Expand Down

0 comments on commit 59ca8e4

Please sign in to comment.