Skip to content

Commit 4e67f0a

Browse files
committed
Set QUARTO_R for ealier versions of Quarto to overcome the R_HOME detection problem
Fixed in 1.8 at quarto-dev/quarto-cli#12887
1 parent 58094a0 commit 4e67f0a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

R/quarto.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ quarto_run <- function(
128128
...,
129129
.call = rlang::caller_env()
130130
) {
131+
# This is required due to a bug in QUARTO CLI, fixed only in 1.8+
132+
# https://github.com/quarto-dev/quarto-cli/pull/12887
133+
custom_env <- NULL
134+
if (!quarto_available(min = "1.8.12")) {
135+
custom_env <- c("current", QUARTO_R = R.home("bin"))
136+
}
131137
res <- tryCatch(
132138
{
133139
processx::run(
@@ -136,6 +142,7 @@ quarto_run <- function(
136142
echo = echo,
137143
error_on_status = TRUE,
138144
echo_cmd = echo_cmd,
145+
env = custom_env,
139146
...
140147
)
141148
},

0 commit comments

Comments
 (0)