Skip to content

Commit

Permalink
test: Fix detection of galley mode (loaded vs. installed) to support …
Browse files Browse the repository at this point in the history
…custom test environments
  • Loading branch information
krlmlr committed May 27, 2024
1 parent 0686ca5 commit 155fa21
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions R/galley.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 155fa21

Please sign in to comment.