R/libpaths.R

Defines functions with_temp_lib

# While not in devtools or new package
with_temp_lib <- function(code) {
  lib_paths <- tempfile("lib", fileext = "rpkgweb")
  dir.create(lib_paths)

  all_lib_paths <- c(lib_paths, .libPaths())

  devtools::with_libpaths(all_lib_paths, code)
}
krlmlr/rpkgweb documentation built on May 20, 2019, 6:18 p.m.