-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
Currently if one pressed "Run all" in RStudio, one gets an error because usethis
expects itself to be called from a package directory, but create-mypkg.Rmd
lives in mypkg-project
. One gets the error in the usethis::create_package()
call and also in calls to usethis::use_package()
.
It'd be nice if "Run all" would work in Rstudio. Or if there's a simple alternative, e.g., a function like litr::load_all("create-mypkg.Rmd")
that would load the current code into the console. At this point, I can think of two approaches for implementing litr::load_all()
:
- It calls
litr::render()
and thendevtools::load_all("mypkg/")
. I don't love this approach becauselitr::render()
can be slow and I'm hoping for something more immediate. - Use mockery to replace all
usethis
functions with stubs that don't do anything. I believe this should work but it might have some side-effects that I'm not thinking of.
It's also worth looking into what happens when one clicks "Run all" to see if one can do something like approach 2 before running all blocks.
Metadata
Metadata
Assignees
Labels
No labels