Skip to content

Commit

Permalink
more renv option mapping/restoration
Browse files Browse the repository at this point in the history
  • Loading branch information
aronatkins committed Nov 12, 2021
1 parent a35ef86 commit 8e42eb7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions R/dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ ignoredDirsForRenv <- function(ignoredDirs) {
}

dirDependenciesRenv <- function(dir) {
old <- options(renv.config.filebacked.cache = FALSE)
on.exit(do.call(options, old), add = TRUE)
old_filebacked_cache <- options(renv.config.filebacked.cache = FALSE)
on.exit(do.call(options, old_filebacked_cache), add = TRUE)

project <- Sys.getenv("RENV_PROJECT", unset = NA)
if (!is.na(project)) {
Expand All @@ -154,6 +154,16 @@ dirDependenciesRenv <- function(dir) {
on.exit(Sys.setenv(RENV_PROFILE = profile), add = TRUE)
}

old_ignored_packages <- options("renv.settings.ignored.packages" = opts$ignored.packages())
on.exit(do.call(options, old_ignored_packages), add = TRUE)

# TODO:
# old_renv_ignore <- options("renv.settings.ignore.matching" = ignoredDirsForRenv(opts$ignored.directories())
# on.exit(do.call(options, old_renv_ignore), add = TRUE)

# TODO: add rsconnect as an ignored directory? May not be an issue for
# bundling, since we don't include the rsconnect directory.

deps <- renv$dependencies(path = dir, quiet = TRUE)
pkgs <- unique(deps$Package)
# remove accidents.
Expand Down

0 comments on commit 8e42eb7

Please sign in to comment.