Skip to content

Commit

Permalink
Build vignettes even when local = TRUE.
Browse files Browse the repository at this point in the history
Closes #344
  • Loading branch information
hadley committed Oct 7, 2013
1 parent 14ffa43 commit 9a7253b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions NEWS
@@ -1,6 +1,9 @@
devtools 1.3.99
----------------

* `install()` gains a `build_vignettes` which defaults to TRUE, and ensures
that vignettes are built even when doing a local install. (#344)

* `check()` gains new `check_dir` argument to control where checking takes
place (#337)

Expand Down
9 changes: 7 additions & 2 deletions R/install.r
Expand Up @@ -31,14 +31,18 @@
#' @param dependencies \code{logical} indicating to also install uninstalled
#' packages which this \code{pkg} depends on/links to/suggests. See
#' argument \code{dependencies} of \code{\link{install.packages}}.
#' @param build_vignettes if \code{TRUE}, will build vignettes. Normally it is
#' \code{build} that's responsible for creating vignettes; this argument makes
#' sure vignettes are built even if a build never happens (i.e. because
#' \code{local = TRUE}.
#' @export
#' @family package installation
#' @seealso \code{\link{with_debug}} to install packages with debugging flags
#' set.
#' @importFrom utils install.packages
install <- function(pkg = ".", reload = TRUE, quick = FALSE, local = TRUE,
args = getOption("devtools.install.args"), quiet = FALSE,
dependencies = NA) {
dependencies = NA, build_vignettes = !quick) {

pkg <- as.package(pkg)

Expand All @@ -48,8 +52,9 @@ install <- function(pkg = ".", reload = TRUE, quick = FALSE, local = TRUE,
# Build the package. If quick, don't build vignettes
if (local) {
built_path <- pkg$path
if (build_vignettes) build_vignettes(pkg)
} else {
built_path <- build(pkg, tempdir(), vignettes = !quick, quiet = quiet)
built_path <- build(pkg, tempdir(), vignettes = build_vignettes, quiet = quiet)
on.exit(unlink(built_path))
}

Expand Down

0 comments on commit 9a7253b

Please sign in to comment.