R/has_all_tools.R

Defines functions has_all_tools

Documented in has_all_tools

#' General install test
#'
#' This function just checks whether you have the necessary packages for
#' following the course.
#'
#' @param debug if \code{TRUE}, will print out extra information for debugging.
#' Defaults to `FALSE`.
#'
#' @return a single logical value
#'
#' @importFrom pkgbuild has_build_tools
#' @importFrom utils installed.packages
#'
#' @export
has_all_tools <- function(debug = FALSE){

  installed <- rownames(installed.packages())

  needs <- c("roxygen2", "pkgbuild", "devtools", "remotes")

  pkgs <- all( needs %in% installed)
  tools <- pkgbuild::has_build_tools()

  return(tools && pkgs)
}
JoFAM/installtest documentation built on Jan. 28, 2021, 11:44 a.m.