Skip to content

Commit 7475ff2

Browse files
committed
handle specific transformation for windows CI
quarto is install with scoop, and somehow the normalization of the symlink does not happen in quarto stack strace on CI
1 parent da90b38 commit 7475ff2

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

R/quarto.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,22 @@
33
#' Determine the path to the quarto binary. Uses `QUARTO_PATH` environment
44
#' variable if defined, otherwise uses `Sys.which()`.
55
#'
6+
#' @param normalize If `TRUE` (default), normalize the path using [base::normalizePath()].
7+
#'
68
#' @return Path to quarto binary (or `NULL` if not found)
79
#'
810
#' @export
9-
quarto_path <- function() {
11+
quarto_path <- function(normalize = TRUE) {
1012
path_env <- get_quarto_path_env()
1113
quarto_path <- if (is.na(path_env)) {
1214
path <- unname(Sys.which("quarto"))
1315
if (nzchar(path)) path else return(NULL)
1416
} else {
1517
path_env
1618
}
19+
if (!normalize) {
20+
return(quarto_path)
21+
}
1722
normalizePath(quarto_path, winslash = "/", mustWork = FALSE)
1823
}
1924

man/quarto_path.Rd

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/helper.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ transform_quarto_cli_in_output <- function(
158158
# look for normalized path
159159
lines <- hide_path(lines, quarto_found_normalized)
160160

161+
# look for specific non-symlink path from Quarto CLI output
162+
non_normalized_path <- quarto_path(normalize = FALSE)
163+
non_normalized_path_slash <- gsub("\\\\", "/", non_normalized_path)
164+
lines <- hide_path(lines, non_normalized_path)
165+
lines <- hide_path(lines, non_normalized_path_slash)
166+
161167
# seems like there are quotes around path in CI windows
162168
lines <- gsub(
163169
"\"<quarto full path>([^\"]*)\"",

0 commit comments

Comments
 (0)