Skip to content

Commit

Permalink
Merge pull request #12 from jhudsl/cansavvy/owd-error
Browse files Browse the repository at this point in the history
Get rid of setwd() bits
  • Loading branch information
cansavvy authored Aug 25, 2021
2 parents e648ebd + 35881cc commit bba0fc8
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions R/bookdown_to_leanpub.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,7 @@ bookdown_to_leanpub = function(path = ".",
rmd_regex = "[.][R|r]md$"

path = bookdown_path(path)
owd = getwd()
setwd(path)
on.exit({
setwd(owd)
})

rmd_files = bookdown_rmd_files(path = path)
if (render) {
if (verbose) {
Expand Down Expand Up @@ -233,11 +229,7 @@ bookdown_to_book_txt = function(
rm(list = c("full_file", "index"))

path = bookdown_path(path)
owd = getwd()
setwd(path)
on.exit({
setwd(owd)
})

rmd_regex = "[.][R|r]md$"
rmd_files = bookdown_rmd_files(path = path)
md_files = sub(rmd_regex, ".md", rmd_files, ignore.case = TRUE)
Expand Down

0 comments on commit bba0fc8

Please sign in to comment.