Skip to content

Commit cedaac9

Browse files
committed
only move _files/_cache dirs that have corresponding Rmd files
this should fix the problem reported at #1307 (comment), in which case config_files was moved by mistake
1 parent a0ef873 commit cedaac9

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: bookdown
22
Type: Package
33
Title: Authoring Books and Technical Documents with R Markdown
4-
Version: 0.36.1
4+
Version: 0.36.2
55
Authors@R: c(
66
person("Yihui", "Xie", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
77
person("Christophe", "Dervieux", , "[email protected]", role = c("ctb"),

NEWS.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
- Custom config files passed to the `config_file` argument of `render_book()` are no longer temporarily renamed to `_bookdown.yml` (thanks, @debruine, #1307).
44

5+
- Do not move all `_files` directories temporarily to the `_bookdown_files` directory when calling `render_book()` (thanks, @steeleb, #1307).
6+
57
# CHANGES IN bookdown VERSION 0.36
68

79
- Fix an issue with parsing resources from raw HTML code (thanks, @lennylin, https://community.rstudio.com/t/bookdown-image-with-a-weblink/172542)

R/utils.R

+4-1
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,11 @@ base64_css = function(css, exts = 'png', overwrite = FALSE) {
448448

449449
files_cache_dirs = function(dir = '.') {
450450
if (!dir_exists(dir)) return(character())
451-
out = list.files(dir, '_(files|cache)$', full.names = TRUE)
451+
r = '_(files|cache)$'
452+
out = list.files(dir, r, full.names = TRUE)
452453
out = out[dir_exists(out)]
454+
# only use dirs that have corresponding Rmd files
455+
if (dir == '.') out = out[file.exists(sub(r, '.Rmd', out))]
453456
out = out[basename(out) != '_bookdown_files']
454457
out
455458
}

0 commit comments

Comments
 (0)