Skip to content

Commit

Permalink
update precompile vignette script for new figure file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlambert committed Jan 22, 2025
1 parent 7587433 commit 8be05e0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions vignettes/precompile.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ knitr::knit(
)

# run from package root directory
figures <- file.path(list.files(path = "figure", pattern = "^plot-.*\\.png$"))
if (!dir.exists(file.path("vignettes", "figure"))) {
dir.create(file.path("vignettes", "figure"))
}
figures <- file.path(list.files(path = ".", pattern = "^plot-.*\\.png$"))
cp <- file.copy(
from = file.path("figure", figures),
to = file.path("vignettes", "figure"),
from = file.path(".", figures),
to = file.path("vignettes", "articles"),
overwrite = TRUE
)
if (all(cp)) {
unlink(file.path("figure"), recursive = TRUE)
unlink(figures)
} else {
print("Article figures did not copy, please inspect manually.")
}

0 comments on commit 8be05e0

Please sign in to comment.