jhudsl / ottrpal

Tools for converting OTTR courses into Leanpub or Coursera courses :otter:
https://jhudatascience.org/ottrpal/
GNU General Public License v3.0
3 stars 1 forks source link

Get rid of setwd() bits #12

Closed cansavvy closed 3 years ago

cansavvy commented 3 years ago

The setwd() bits are throwing off the leanbuild::bookdown_to_leanpub() function when I attempt to call it from outside of R like:

Rscript -e "leanbuild::bookdown_to_leanpub()" 

This makes this error:

Error in bookdown::render_book(input = input, output_format = output_format) : 
  object 'input' not found
Calls: <Anonymous> -> <Anonymous> -> <Anonymous> -> resolve -> basename
Error in setwd(owd) : object 'owd' not found

An example: https://github.com/jhudsl/ITCR_Documentation_and_Usability_Leanpub/runs/3423258226?check_suite_focus=true

It doesn't appear to be serving a function and setwd() is dicey sometimes anyway so I tried deleting it and running the command without it and it works fine.

I may find out later why this chunk was needed but I guess I'll cross that bridge when I come to it.