Skip to content

Commit

Permalink
Allow update_packages() prompt to be overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
pkq committed Jan 26, 2017
1 parent d8ab190 commit f084d64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.md
Expand Up @@ -97,6 +97,7 @@
a repo.

* `use_readme_rmd()` and `use_readme()` share a common template with sections for package overview, GitHub installation (if applicable), and an example (@jennybc, #1287).
* `update_packages()` allows for override of interactive prompt (#1260, @pkq).

* `test()` doesn't load helpers twice anymore (@krlmlr, #1256).

Expand Down
5 changes: 4 additions & 1 deletion R/deps.R
Expand Up @@ -379,7 +379,10 @@ update_packages <- function(pkgs = NULL, dependencies = NA,
repos = getOption("repos"),
type = getOption("pkgType")) {

if (is.null(pkgs)) {
if (isTRUE(pkgs)) {
pkgs <- installed.packages()[, "Package"]
}
else if (is.null(pkgs)) {
if (!yesno("Are you sure you want to update all installed packages?")) {
pkgs <- installed.packages()[, "Package"]
} else {
Expand Down

0 comments on commit f084d64

Please sign in to comment.