Closed ColinFay closed 1 year ago
It looks like the code already exists to do this (https://github.com/rstudio/rsconnect/commit/31d518b255c6080145271107d8193be5b8d38f63). But it seems like it existed at the time you filed the issue, so I'll do a little exploration.
Note: I'm not sure if it's a
{rsconnect}
or{renv}
issue, @kevinushey feel free to correct me if you think this feature should be in{renv}
instead.If I create a new
{shiny}
app, userenv::init()
, then dorsconnect::deployApp()
, it will fail.The reason behind this is that the .Rprofile contains a call to
source("renv/activate.R")
, and by default, clicking on the blue button in RStudio sends all the files exceptrenv/
&renv.lock
(so doesrsconnect::deployApp()
.Also, trying to include the
renv/
folder by hand will fail:Possible solution :
From the user perspective :
source("renv/activate.R")
inside an if statement detecting if we are on Connect / shinyapps.ioin
{rsconnect}
renv/
folder alongside the appsource("renv/activate.R")
in
{renv}
source("renv/activate.R")
inside an if statement detecting if we are on Connect / shinyapps.ioThat being said, maybe you have a better workflow here.
I'm deploying apps on Connect from Git, that we locally build using
{renv}
, and that would be nice to have them both work flawlessly without tweaking the.Rprofile
:)Cheers, Colin