Skip to content

Commit

Permalink
fix #363
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Sep 21, 2023
1 parent 4009948 commit 40365d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions inst/actions/zen4R_deposit_record.R
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,12 @@ function(action, entity, config){
switch(strategy,
"edition" = ZENODO$depositRecord(zenodo_metadata, publish = publish),
"newversion" = {
data_files <- list.files(file.path(getwd(),"data"), pattern = depositDataPattern)
data_files <- list.files(file.path(getwd(),"data"), pattern = depositDataPattern, full.names = T)

if(zipEachDataFile){
config$logger.info("Zenodo: 'zipEachDaTafile' is true - zipping data files")
data_files <- lapply(data_files, function(data_file){
data_file = basename(data_file)
config$logger.info(sprintf("Zenodo: 'zipEachDaTafile' is true - zipping each data file '%s'", data_file))
fileparts <- unlist(strsplit(data_file, "\\."))
if(length(fileparts)>1) fileparts <- fileparts[1:(length(fileparts)-1)]
Expand All @@ -396,7 +397,7 @@ function(action, entity, config){
})
}

metadata_files <- list.files(file.path(getwd(),"metadata"))
metadata_files <- list.files(file.path(getwd(),"metadata"), full.names = TRUE)
files_to_upload <- if(depositWithFiles & (!update | (update & update_files))) c(data_files, metadata_files) else NULL
ZENODO$depositRecordVersion(
record = zenodo_metadata,
Expand Down

0 comments on commit 40365d4

Please sign in to comment.