Skip to content

Commit 281d3d0

Browse files
committed
Report the LaTeX error from stderr when build_manual() fails.
This parses the stderr text for the "LaTeX Error:" line and reports it if it's found.
1 parent 73fc811 commit 281d3d0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

R/build-manual.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ build_manual <- function(pkg = ".", path = NULL) {
1717
), fail_on_status = TRUE, stderr = "2>&1", spinner = FALSE),
1818
error = function(e) {
1919
cat(e$stdout)
20-
cli::cli_abort("Failed to build manual")
20+
msg <- regmatches(e$stderr,
21+
regexpr("LaTeX Error:.*", e$stderr, perl = TRUE))
22+
cli::cli_abort(c("x" = msg,
23+
"!" = "Failed to build manual"))
2124
})
2225

2326
cat(msg$stdout)

0 commit comments

Comments
 (0)