Skip to content

Commit

Permalink
Add on.exit() to render()
Browse files Browse the repository at this point in the history
Remove tmp- files
  • Loading branch information
seananderson committed Dec 7, 2023
1 parent 2485100 commit 2ea95ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: csasdown
Title: Reproducible CSAS Reports with Bookdown
Version: 0.1.2
Version: 0.1.3
Authors@R:
c(person(given = c("Sean", "C."),
family = "Anderson",
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# csasdown

# csasdown 0.1.3

* Add `on.exit()` to `csasdown::render()` to avoid leaving behind `tmp-` files
if an R error is encountered.

* Fix `csasdown::render()` render environment.

# csasdown 0.1.2

* The Science Response template now uses `french_title` instead of `title_other`
Expand Down
1 change: 1 addition & 0 deletions R/render.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ render <- function(yaml_fn = "_bookdown.yml",
tmp_yaml_rmd_fns <- create_tmp_yaml_rmd_files(yaml_fn, verbose)
tmp_yaml_fn <- tmp_yaml_rmd_fns[[1]]
tmp_rmd_fns <- tmp_yaml_rmd_fns[[2]]
on.exit(unlink(unlist(tmp_yaml_rmd_fns), force = TRUE))

index_fn <- get_index_filename(tmp_yaml_fn, verbose)
set_render_type(index_fn, "asis")
Expand Down

0 comments on commit 2ea95ae

Please sign in to comment.