From 9a7253ba784d8612e0be4015d604482609157a2a Mon Sep 17 00:00:00 2001 From: hadley Date: Mon, 7 Oct 2013 13:55:58 -0500 Subject: [PATCH] Build vignettes even when local = TRUE. Closes #344 --- NEWS | 3 +++ R/install.r | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 7a4e3e50f..c6d5d4e20 100644 --- a/NEWS +++ b/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) diff --git a/R/install.r b/R/install.r index fda1d3ace..af98ed4ec 100644 --- a/R/install.r +++ b/R/install.r @@ -31,6 +31,10 @@ #' @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 @@ -38,7 +42,7 @@ #' @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) @@ -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)) }