Skip to content

Commit

Permalink
Also record path
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Apr 24, 2024
1 parent d7bed3a commit 03755ca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion R/fonts.R
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,9 @@ font_dep_google_local <- function(x) {
return(font_dep_google_local(x))
}
if (needs_message) {
rlang::inform(paste0("Downloading google font ", x$family, " to local cache"))
rlang::inform(paste0(
"Downloading google font ", x$family, " to local cache (", x$cache$dir(), ")"
))
needs_message <<- FALSE
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/font-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
Code
tagz <- renderTags(tags$style(sass(scss)))
Message
Downloading google font Pacifico to local cache
Downloading google font Pacifico to local cache (<temp-cache>)

---

Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/test-font-objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ test_that("font_google(local = TRUE) basically works", {
)

# 1st time rendering font should add files to cache
expect_snapshot(tagz <- renderTags(tags$style(sass(scss))))
expect_snapshot(
tagz <- renderTags(tags$style(sass(scss))),
transform = function(x) gsub(normalizePath(tmpdir), "<temp-cache>", x)
)
size <- cache$size()
expect_true(size > 0)

Expand Down

0 comments on commit 03755ca

Please # to comment.