rstudio/vetiver-r

`path` argument not fully respected

Closed this issue · 1 comments

The path argument is, as i understand it, intended to be where the lockfile and the dockerfile are to be placed. At present the renv.lock is placed into the working directory while the Dockerfile ends up where it's supposed to go.

#' @param path A path to write the Dockerfile and `lockfile`, capturing the

library(vetiver)
cars_lm <- lm(mpg ~ ., data = mtcars)
v <- vetiver_model(cars_lm, "cars_linear")

dir.create("inst/vetiver", recursive = TRUE)
vetiver_write_docker(v, path = "inst/vetiver")
#> The version of R recorded in the lockfile will be updated:
#> - R             [* -> 4.3.0]
#> 
#> * Lockfile written to 'vetiver_renv.lock'.

list.files("inst/vetiver")
#> [1] "Dockerfile"
list.files()
#> [1] "inst" "vetiver_renv.lock"

Created on 2023-05-24 with reprex v2.0.2

Ah, I think renv::snapshot(project = path, ...) took care of this in the past (???) but I will get this fixed. Thanks!