diff --git a/R/export.R b/R/export.R index eabfae03..5717bd0a 100644 --- a/R/export.R +++ b/R/export.R @@ -32,8 +32,14 @@ orderly_export_zip <- function(path, packets, root = NULL, locate = TRUE) { file.path(root$path, ".outpack", "metadata", packets), file.path(dest, "metadata", packets)) - for (hash in files) { - store$put(find_file_by_hash(root, hash), hash) + if (root$config$core$use_file_store) { + for (hash in files) { + store$put(root$files$filename(hash), hash) + } + } else { + for (hash in files) { + store$put(find_file_by_hash(root, hash), hash) + } } packet_list <- index$location[ diff --git a/tests/testthat/test-export.R b/tests/testthat/test-export.R index f269d31c..2f2aa175 100644 --- a/tests/testthat/test-export.R +++ b/tests/testthat/test-export.R @@ -42,7 +42,7 @@ test_that("Can export multiple packets", { }) test_that("Can export from a file store", { - root <- create_temporary_root(use_file_store = TRUE) + root <- create_temporary_root(use_file_store = TRUE, path_archive = NULL) ids <- create_random_packet_chain(root, 3) path <- withr::local_tempfile()