Skip to content

Commit

Permalink
Return name of package which was installed
Browse files Browse the repository at this point in the history
Fixes r-lib#55
  • Loading branch information
jimhester committed Aug 28, 2018
1 parent bff068b commit c1d9e0f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Expand Up @@ -5,6 +5,9 @@

# Development

* `install_()` functions now return the name of the package(s) which were
installed (#55).

* Dependency parsing is now more robust to whitespace around the dependency
specifications (#73).

Expand Down
6 changes: 3 additions & 3 deletions R/install-remote.R
Expand Up @@ -24,14 +24,14 @@ install_remote <- function(remote, ..., force = FALSE, quiet = FALSE) {
" the SHA1 (", substr(remote_sha, 1L, 8L), ") has not changed since last install.\n",
" Use `force = TRUE` to force installation")
}
return(invisible(FALSE))
return(invisible(package_name))
}

if (inherits(remote, "cran_remote")) {
install_packages(
package_name, repos = remote$repos, type = remote$pkg_type,
..., quiet = quiet)
return(invisible(TRUE))
return(invisible(package_name))
}

bundle <- remote_download(remote, quiet = quiet)
Expand All @@ -51,7 +51,7 @@ install_remote <- function(remote, ..., force = FALSE, quiet = FALSE) {
}

install_remotes <- function(remotes, ...) {
invisible(vapply(remotes, install_remote, ..., FUN.VALUE = logical(1)))
invisible(vapply(remotes, install_remote, ..., FUN.VALUE = character(1)))
}

# Add metadata
Expand Down
3 changes: 2 additions & 1 deletion R/install.R
Expand Up @@ -33,7 +33,8 @@ install <- function(pkgdir = ".", dependencies = NA, quiet = TRUE, build =
...
)

invisible(TRUE)
pkg_name <- load_pkg_description(pkgdir)$package
invisible(pkg_name)
}


Expand Down

0 comments on commit c1d9e0f

Please sign in to comment.