From 155fa21441e7afd6369c021c204b7a4696b934d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Mon, 27 May 2024 06:15:03 +0200 Subject: [PATCH] test: Fix detection of galley mode (loaded vs. installed) to support custom test environments --- R/galley.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/R/galley.R b/R/galley.R index 78ed018a8..713371ebe 100644 --- a/R/galley.R +++ b/R/galley.R @@ -32,16 +32,16 @@ galley_use_installed <- function() { render_galley <- function(name, md_name) { pkg <- utils::packageName() - # FIXME: Hack! installed <- galley_use_installed() - # stopifnot(!installed) - if (installed) { - input_path <- system.file("doc", name, package = pkg) - } else { + if (!installed) { input_path <- system.file("vignettes", name, package = pkg) } + if (installed || !file.exists(input_path)) { + input_path <- system.file("doc", name, package = pkg) + } + # Need fixed file name for stability output_dir <- tempdir() output_file <- md_name