Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

be verbose if we're going to prompt #1615

Merged
merged 3 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions R/clean.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ clean <- function(project = NULL,

project <- renv_project_resolve(project)
renv_project_lock(project = project)
renv_scope_verbose_if(prompt)

renv_activate_prompt("clean", NULL, prompt, project)

Expand Down
1 change: 1 addition & 0 deletions R/hydrate.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ hydrate <- function(packages = NULL,

project <- renv_project_resolve(project)
renv_project_lock(project = project)
renv_scope_verbose_if(prompt)

renv_activate_prompt("hydrate", library, prompt, project)

Expand Down
1 change: 1 addition & 0 deletions R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ install <- function(packages = NULL,

project <- renv_project_resolve(project)
renv_project_lock(project = project)
renv_scope_verbose_if(prompt)

# handle 'dependencies'
if (!is.null(dependencies)) {
Expand Down
4 changes: 3 additions & 1 deletion R/lockfiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,11 @@ lockfile_create <- function(type = settings$snapshot.type(project = project),
...,
project = NULL)
{
project <- renv_project_resolve(project)
renv_dots_check(...)

project <- renv_project_resolve(project)
renv_scope_verbose_if(prompt)

renv_lockfile_create(
project = project,
type = type,
Expand Down
8 changes: 1 addition & 7 deletions R/pretty.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@ renv_pretty_print_records <- function(preamble, records, postamble = NULL) {
records <- records[sort(names(records))]
packages <- names(records)
descs <- map_chr(records, renv_record_format_short)

text <- sprintf("- %s [%s]", format(packages), descs)

all <- c(
preamble,
text,
postamble, if (length(postamble)) ""
)

all <- c(preamble, text, postamble, if (length(postamble)) "")
renv_caution_impl(all)

}
Expand Down
1 change: 1 addition & 0 deletions R/purge.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ purge <- function(package,
{
renv_scope_error_handler()
renv_dots_check(...)
renv_scope_verbose_if(prompt)
invisible(renv_purge_impl(package, version, hash, prompt))
}

Expand Down
1 change: 1 addition & 0 deletions R/rebuild.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ rebuild <- function(packages = NULL,

project <- renv_project_resolve(project)
renv_project_lock(project = project)
renv_scope_verbose_if(prompt)

libpaths <- renv_libpaths_resolve(library)
library <- nth(libpaths, 1L)
Expand Down
1 change: 1 addition & 0 deletions R/rehash.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
rehash <- function(prompt = interactive(), ...) {
renv_scope_error_handler()
renv_dots_check(...)
renv_scope_verbose_if(prompt)
invisible(renv_rehash_impl(prompt))
}

Expand Down
1 change: 1 addition & 0 deletions R/restore.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ restore <- function(project = NULL,

project <- renv_project_resolve(project)
renv_project_lock(project = project)
renv_scope_verbose_if(prompt)

# resolve library, lockfile arguments
libpaths <- renv_libpaths_resolve(library)
Expand Down
3 changes: 2 additions & 1 deletion R/roxygen.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#' @param type The type of package to install ("source" or "binary"). Defaults
#' to the value of `getOption("pkgType")`.
#'
#' @param lockfile Path to a lockfile. When `NULL` (the default), the `renv.lock` located in the root of the current project will be used.
#' @param lockfile Path to a lockfile. When `NULL` (the default), the
#' `renv.lock` located in the root of the current project will be used.
#'
#' @param library The \R library to be used. When `NULL`, the active project
#' library will be used instead.
Expand Down
9 changes: 9 additions & 0 deletions R/scope.R
Original file line number Diff line number Diff line change
Expand Up @@ -389,3 +389,12 @@ renv_scope_caution <- function(value) {
scope = parent.frame()
)
}

renv_scope_verbose_if <- function(value, scope = parent.frame()) {
if (value) {
renv_scope_options(
renv.verbose = TRUE,
scope = scope
)
}
}
1 change: 1 addition & 0 deletions R/snapshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ snapshot <- function(project = NULL,

project <- renv_project_resolve(project)
renv_project_lock(project = project)
renv_scope_verbose_if(prompt)

repos <- renv_repos_validate(repos)
renv_scope_options(repos = repos)
Expand Down
1 change: 1 addition & 0 deletions R/update.R
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ update <- function(packages = NULL,

project <- renv_project_resolve(project)
renv_project_lock(project = project)
renv_scope_verbose_if(prompt)

# resolve library path
libpaths <- renv_libpaths_resolve(library)
Expand Down
1 change: 1 addition & 0 deletions R/upgrade.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ upgrade <- function(project = NULL,
prompt = interactive())
{
renv_scope_error_handler()
renv_scope_verbose_if(prompt)
invisible(renv_upgrade_impl(project, version, reload, prompt))
}

Expand Down
3 changes: 2 additions & 1 deletion man/record.Rd

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

3 changes: 2 additions & 1 deletion man/restore.Rd

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

3 changes: 2 additions & 1 deletion man/status.Rd

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

Loading