Skip to content

Commit 304b40f

Browse files
committed
another way to check if any new packages need to be included in pkgs-yihui.txt
1 parent 000a2d5 commit 304b40f

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

tools/test-packages.R

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,12 @@ build_more = function() {
4545
render('test-basic.Rmd', 'beamer_presentation', quiet = TRUE)
4646
render('test-kableExtra.Rmd', quiet = TRUE)
4747
}
48-
# do not automatically install missing LaTeX packages; if the compilation
49-
# fails, try to install packages and compile again; if it succeeds, output the
50-
# new packages required
51-
opts = options(tinytex.install_packages = FALSE)
52-
tryCatch(build_more(), error = function(e) {
53-
message(e)
54-
options(opts)
55-
build_more()
56-
x4 = tinytex::tl_pkgs()
57-
if (length(x5 <- setdiff(x4, x3))) stop(
58-
'pkgs-yihui.txt needs to include:\n', paste(x5, collapse = '\n')
59-
)
60-
})
61-
options(opts)
48+
build_more()
49+
# were there any new packages installed?
50+
x4 = tinytex::tl_pkgs()
51+
if (length(x5 <- setdiff(x4, x3))) stop(
52+
'pkgs-yihui.txt needs to include:\n', paste(x5, collapse = '\n')
53+
)
6254

6355
unlink('texlive', recursive = TRUE)
6456
setwd(owd)

0 commit comments

Comments
 (0)