Skip to content

Commit

Permalink
the env var doesn't work for 3.2.x, so we create an empty .R script
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Aug 2, 2024
1 parent 9023f5c commit c129250
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
R_KEEP_PKG_SOURCE: yes
_R_CHECK_FORCE_SUGGESTS_: false
_R_CHECK_RD_XREFS_: false
_R_CHECK_VIGNETTES_SKIP_RUN_MAYBE_: true

steps:
- uses: actions/checkout@HEAD
Expand Down
9 changes: 6 additions & 3 deletions R/package.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,14 @@ record_print.knitr_kable = function(x, ...) {
# weave or tangle?
vig_fun = function(weave = TRUE) {
function(file, quiet = FALSE, ...) {
empty_file = function() write_utf8(character(), with_ext(file, '.R'))
# fuse() .Rmd and mark() .md
if (grepl('[.]Rmd$', file)) {
if (weave) fuse(file, quiet = quiet, envir = globalenv()) else fiss(file)
} else if (weave) mark(file) else {
write_utf8(character(), with_ext(file, '.R'))
if (weave) fuse(file, quiet = quiet, envir = globalenv()) else {
if (getRversion() <= '3.2.5') empty_file() else fiss(file)
}
} else {
if (weave) mark(file) else empty_file()
}
}
}
Expand Down

0 comments on commit c129250

Please sign in to comment.