R/repair.R

Defines functions renv_repair

# NOTE: mostly for internal use when i accidentally
# link packages in the user library into the cache
renv_repair <- function(library = NULL) {
  library <- renv_path_normalize(library %||% renv_libpaths_default())
  paths <- list.files(library, full.names = TRUE)
  links <- Sys.readlink(paths)
  broken <- nzchar(links) & !file.exists(links)
  packages <- basename(paths[broken])
  install(packages, library = library)
}
wnattt/renv documentation built on Dec. 23, 2021, 5:19 p.m.