Skip to content

Commit

Permalink
Added zip flags
Browse files Browse the repository at this point in the history
  • Loading branch information
dipterix committed Aug 27, 2024
1 parent 889b2b4 commit 6ef4041
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 10 additions & 2 deletions R/utils-archive.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#' temporary path. Set this variable explicitly when temporary path is
#' on external drives (for example, users have limited storage on local
#' drives and cannot hold the entire subject)
#' @param zip_flags \code{\link[utils]{zip}} flags
#'
#' @examples
#'
Expand Down Expand Up @@ -58,7 +59,8 @@ archive_subject <- function(
includes = c("orignal_signals", "processed_data", "rave_imaging",
"pipelines", "notes", "user_generated"),
config = list(),
work_path = NULL
work_path = NULL,
zip_flags = NULL
) {

# DIPSAUS DEBUG START
Expand Down Expand Up @@ -390,7 +392,13 @@ archive_subject <- function(
# zip
setwd(dirname(root_dir))
zipfile_name <- sprintf("./%s.zip", rand_string(10))
utils::zip(zipfile = zipfile_name, files = "./archive")

if(length(zip_flags)) {
utils::zip(zipfile = zipfile_name, files = "./archive", flags = zip_flags)
} else {
utils::zip(zipfile = zipfile_name, files = "./archive")
}

zipfile_name <- normalizePath(zipfile_name)

setwd(current_wd)
Expand Down
5 changes: 4 additions & 1 deletion man/archive_subject.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6ef4041

Please sign in to comment.