Skip to content

Commit

Permalink
Fix export from file store
Browse files Browse the repository at this point in the history
  • Loading branch information
plietar committed Mar 19, 2024
1 parent b51bd90 commit 44b19f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions R/export.R
Original file line number Diff line number Diff line change
Expand Up @@ -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[
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-export.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 44b19f4

Please sign in to comment.