From 9e2ccdff4b9a5c38365ba69c94cda89c462275bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Thu, 13 Sep 2018 23:51:38 +0200 Subject: [PATCH] Install before building pkgdown, closes #89 --- R/steps-pkgdown.R | 9 +++------ R/steps-rcmdcheck.R | 7 ++----- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/R/steps-pkgdown.R b/R/steps-pkgdown.R index efcc9af9..70d7fa53 100644 --- a/R/steps-pkgdown.R +++ b/R/steps-pkgdown.R @@ -9,15 +9,12 @@ BuildPkgdown <- R6Class( }, run = function() { - # Don't need to be super-strict when building pkgdown - withr::with_libpaths( - super$get_lib(), action = "prefix", - do.call(pkgdown::build_site, c(list(preview = FALSE), private$pkgdown_args)) - ) + remotes::install_local(".") + do.call(pkgdown::build_site, c(list(preview = FALSE), private$pkgdown_args)) }, prepare = function() { - verify_install("pkgdown") + verify_install(c("pkgdown", "remotes")) super$prepare() } ), diff --git a/R/steps-rcmdcheck.R b/R/steps-rcmdcheck.R index 6608f591..fe5bca17 100644 --- a/R/steps-rcmdcheck.R +++ b/R/steps-rcmdcheck.R @@ -8,15 +8,12 @@ TicStepWithPackageDeps <- R6Class( verify_install("remotes") remotes::install_deps(dependencies = TRUE) - utils::update.packages(lib.loc = self$get_lib()[[1]], ask = FALSE) - }, - get_lib = function() { # Using a separate library for "build dependencies" # (which might well be ahead of CRAN) # works very poorly with custom steps that are not aware # of this shadow library. - .libPaths() + utils::update.packages(ask = FALSE) } ), ) @@ -35,7 +32,7 @@ RCMDcheck <- R6Class( }, run = function() { - res <- rcmdcheck::rcmdcheck(args = private$args, libpath = super$get_lib()) + res <- rcmdcheck::rcmdcheck(args = private$args) print(res) if (length(res$errors) > 0) {