7
7
# ' @param pkg [\code{character}]\cr
8
8
# ' Name of one or more \code{NVIverse} packages.
9
9
# ' @param auth_token [\code{character}]\cr
10
- # ' To install \code{NVIconfig} a personal access token is needed. Generate a personal
11
- # ' access token (PAT) in "https://github.com/settings/tokens" and
10
+ # ' To install \code{NVIconfig} a personal access token is needed. Generate a
11
+ # ' personal access token (PAT) in "https://github.com/settings/tokens" and
12
12
# ' supply to this argument. Defaults to \code{NULL}.
13
13
# ' @param dependencies [\code{logical(1) | character}]\cr
14
14
# ' The dependencies to check and eventually install. Can be
20
20
# ' and is the default.
21
21
# ' @param upgrade [\code{logical(1) | character(1)}]\cr
22
22
# ' Should package dependencies be upgraded? One of c("ask", "always", "never").
23
- # ' \code{TRUE} and \code{FALSE} are also accepted and correspond to "always" and "never"
24
- # ' respectively. Defaults to \code{FALSE}.
23
+ # ' \code{TRUE} and \code{FALSE} are also accepted and correspond to
24
+ # ' "always" and "never" respectively. Defaults to \code{FALSE}.
25
25
# ' @param build [\code{logical(1)}]\cr
26
26
# ' If \code{TRUE} build the package before installing. Defaults to \code{TRUE}.
27
27
# ' @param build_manual [\code{logical(1)}]\cr
28
28
# ' If \code{FALSE}, don't build PDF manual ('--no-manual').
29
29
# ' Defaults to \code{FALSE}.
30
30
# ' @param build_vignettes [\code{logical(1)}]\cr
31
31
# ' If \code{FALSE}, don't build package vignettes ("--no-build-vignettes").
32
- # ' Defaults to \code{TRUE}.
32
+ # ' Defaults to \code{TRUE}, but is set to \code{FALSE} if necessary packages
33
+ # ' for building vignettes are not installed.
33
34
# ' @param \dots Other arguments to be passed to
34
35
# ' \ifelse{html}{\code{\link[remotes:install_github]{remotes::install_github}}}{\code{remotes::install_github}}.
35
36
@@ -45,6 +46,20 @@ use_NVIverse <- function(pkg,
45
46
build_manual = FALSE ,
46
47
build_vignettes = TRUE ,
47
48
... ) {
49
+
50
+ # PREPARE ARGUMENTS BEFORE CHECKING ----
51
+ # # Change build_vignettes to FALSE if packages to build vignettes is lacking
52
+ # # Building the vignettes requires knitr, rmarkdown, R.rsp and NVIrpackages
53
+ if (isTRUE(build_vignettes )) {
54
+ if (! isTRUE(NVIcheckmate :: check_package(x = " knitr" )) |
55
+ ! isTRUE(NVIcheckmate :: check_package(x = " rmarkdown" )) |
56
+ ! isTRUE(NVIcheckmate :: check_package(x = " R.rsp" )) |
57
+ ! isTRUE(NVIcheckmate :: check_package(x = " NVIrpackages" ))) {
58
+ warning(" Vignettes are not built as necessary packages for building vignettes are not installed." )
59
+ build_vignettes <- FALSE
60
+ }
61
+ }
62
+
48
63
# ARGUMENT CHECKING ----
49
64
# Check that NVIcheckmate is installed to avoid using NVIcheckmate functions if not installed
50
65
NVIcheckmate_installed <- FALSE
0 commit comments