diff --git a/R/outpack_root.R b/R/outpack_root.R index 6f936ea8..d61f0254 100644 --- a/R/outpack_root.R +++ b/R/outpack_root.R @@ -107,7 +107,6 @@ file_import_archive <- function(root, path, file_path, name, id) { ## some files behind. This does match the behaviour of the file ## store version, but not of orderly. file_path_dest <- file.path(dest, file_path) - fs::dir_create(dirname(file_path_dest)) ## overwrite = FALSE; see assertion above copy_files(file.path(path, file_path), diff --git a/R/run.R b/R/run.R index 10c1b6d4..917e25a4 100644 --- a/R/run.R +++ b/R/run.R @@ -194,7 +194,8 @@ orderly_run <- function(name, parameters = NULL, envir = NULL, echo = TRUE, if (dat$strict$enabled) { inputs_info <- NULL - copy_files(file.path(src, entrypoint_filename), path) + copy_files(file.path(src, entrypoint_filename), + file.path(path, entrypoint_filename)) } else { inputs_info <- copy_resources_implicit(src, path, dat$resources, dat$artefacts) diff --git a/tests/testthat/test-outpack-config.R b/tests/testthat/test-outpack-config.R index e94524f5..4f7f78f6 100644 --- a/tests/testthat/test-outpack-config.R +++ b/tests/testthat/test-outpack-config.R @@ -97,14 +97,14 @@ test_that("Can add file_store", { expect_equal(length(hash_pulled), 3) dest <- temp_file() - dir.create(dest) - root$dst$files$get(hash_pulled[[1]], dest, TRUE) - root$dst$files$get(hash_pulled[[2]], dest, TRUE) - root$dst$files$get(hash_pulled[[3]], dest, TRUE) + root$dst$files$get(hash_pulled[[1]], file.path(dest, "a"), TRUE) + root$dst$files$get(hash_pulled[[2]], file.path(dest, "b"), TRUE) + root$dst$files$get(hash_pulled[[3]], file.path(dest, "c"), TRUE) hash_not_pulled <- outpack_metadata_core(id[["a"]], root$dst)$files$hash - expect_error(root$dst$files$get(hash_not_pulled[[1]], dest, TRUE), - "not found in store") + expect_error( + root$dst$files$get(hash_not_pulled[[1]], file.path(dest, "d"), TRUE), + "not found in store") }) @@ -144,7 +144,6 @@ test_that("Files will be searched for by hash when adding file store", { expect_true(root$config$core$use_file_store) dest <- temp_file() - dir.create(dest) root$files$get(outpack_metadata_core(id, root)$files$hash, dest, TRUE) }) @@ -247,10 +246,9 @@ test_that("Can add archive", { expect_equal(length(hash), 3) dest <- temp_file() - dir.create(dest) - root$files$get(hash[[1]], dest, TRUE) - root$files$get(hash[[2]], dest, TRUE) - root$files$get(hash[[3]], dest, TRUE) + root$files$get(hash[[1]], file.path(dest, "a"), TRUE) + root$files$get(hash[[2]], file.path(dest, "b"), TRUE) + root$files$get(hash[[3]], file.path(dest, "c"), TRUE) })