Skip to content

Commit

Permalink
add documentation what version renv::upgrade works for and alternativ…
Browse files Browse the repository at this point in the history
…es (#2098)
  • Loading branch information
shannonpileggi authored Feb 27, 2025
1 parent 5c53f39 commit e7a42df
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
14 changes: 12 additions & 2 deletions R/upgrade.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@
#'
#' @description
#' Upgrade the version of renv associated with a project, including using
#' a development version from GitHub. Automatically snapshots the update
#' a development version from GitHub. Automatically snapshots the updated
#' renv, updates the activate script, and restarts R.
#'
#' If you want to update all packages (including renv) to their latest CRAN
#' versions, use [renv::update()].
#'
#' # Note
#'
#' `upgrade()` is expected to work for renv versions ≥1.0.1.
#' To upgrade from prior versions of renv, users should
#'
#' `renv::deactivate();`
#' `install.packages("renv");`
#' `renv::activate();`
#' `renv::record("renv")`
#'
#' @inherit renv-params
#'
#' @param version The version of renv to be installed.
Expand Down Expand Up @@ -111,7 +121,7 @@ renv_upgrade_impl <- function(project, version, reload, prompt) {
# https://github.com/rstudio/renv/issues/2027
autoload <- config$autoloader.enabled()
renv_scope_envvars(RENV_CONFIG_AUTOLOADER_ENABLED = autoload)

code <- expr({
renv <- asNamespace("renv"); renv$summon()
renv_infrastructure_write(
Expand Down
12 changes: 11 additions & 1 deletion man/upgrade.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e7a42df

Please sign in to comment.