Skip to content

Commit

Permalink
allow users to silence startup banner
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Dec 21, 2020
1 parent 2114eaa commit 47579d9
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: renv
Type: Package
Title: Project Environments
Version: 0.12.3-60
Version: 0.12.3-61
Authors@R: c(
person("Kevin", "Ushey", role = c("aut", "cre"), email = "[email protected]"),
person("RStudio", role = c("cph"))
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

# renv 0.13.0 (UNRELEASED)

* The configuration option `startup.quiet` has been added, allowing one to
control whether `renv` will display the typical startup banner when a
project is loaded.

* `renv` now better handles being unloaded and reloaded within the
same R session. In particular, warnings related to a corrupted
lazy-load database should no longer occur. (#600)
Expand Down
9 changes: 9 additions & 0 deletions R/config-defaults.R
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ config <- list(
)
},

startup.quiet = function(..., default = NULL) {
renv_config_get(
name = "startup.quiet",
type = "logical[1]",
default = default,
args = list(...)
)
},

synchronized.check = function(..., default = TRUE) {
renv_config_get(
name = "synchronized.check",
Expand Down
3 changes: 2 additions & 1 deletion R/load.R
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,10 @@ renv_load_finish <- function(project, lockfile) {

renv_load_report_project <- function(project) {

quiet <-
quiet <- config$startup.quiet() %||% (
identical(renv_verbose(), FALSE) ||
renv_session_quiet()
)

if (!quiet) {
fmt <- "* Project '%s' loaded. [renv %s]"
Expand Down
7 changes: 7 additions & 0 deletions inst/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@
creating `renv.lock` -- for example, if a package installed in the project library
depends on a package which is not currently installed.
- name: "startup.quiet"
type: "logical[1]"
default: ~
description: >
Be quiet during startup? When set, `renv` will not display the typical
`Project <path> loaded. [renv <version>]` banner on startup.
- name: "synchronized.check"
type: "logical[1]"
default: true
Expand Down
2 changes: 2 additions & 0 deletions man/config.Rd

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

0 comments on commit 47579d9

Please sign in to comment.