From 8d756f2303ff2f31b8b1997bcdedd8644c3eb858 Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Tue, 15 Dec 2020 23:20:47 +0900 Subject: [PATCH] fix #1980 --- R/render.R | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/R/render.R b/R/render.R index e743d9bb0c..933f6aac66 100644 --- a/R/render.R +++ b/R/render.R @@ -325,6 +325,8 @@ render <- function(input, if (!dir_exists(intermediates_dir)) dir.create(intermediates_dir, recursive = TRUE) intermediates_dir <- normalize_path(intermediates_dir) + } else { + intermediates_dir <- normalize_path(dirname(input)) } intermediates_loc <- function(file) { if (is.null(intermediates_dir)) @@ -364,12 +366,6 @@ render <- function(input, file.copy(input, input_no_shell_chars, overwrite = TRUE) intermediates <- c(intermediates, input_no_shell_chars) input <- input_no_shell_chars - - # if an intermediates directory wasn't explicit before, make it explicit now - if (is.null(intermediates_dir)) { - intermediates_dir <- - dirname(normalize_path(input_no_shell_chars)) - } } # never use the original input directory as the intermediate directory,