tic.R

# R CMD Check OS specific build and check arguments
args <- c("--as-cran","--install-args=--build")
error_on <- "warnings"

# do not treat warnings as errors for windows
if (.Platform$OS.type == "windows") error_on <- "error"

do_package_checks(args = args, error_on = error_on)

InstallRemoteBinaries <- R6Class(
  "InstallRemoteBinaries",
  inherit = TicStep,

  public = list(
    run = function() {
      # get remotes and try to install binaries
      remotes = ghtravis::get_remotes()

      if(!is.null(remotes)) {
        for(remote in remotes) {
          remote_info <- ghtravis::parse_remotes(remote)
          github_user <- sapply(remote_info, `[[`, "username")
          repo <- sapply(remote_info, `[[`, "repo")
          slug <- paste0(paste0(github_user,"/",repo))

          if(!is.null(github_user) && !is.null(repo)) {
            message(paste0("Installing ",repo," binaries"))
            ghtravis::install_remote_binaries(check_r_version = TRUE, force_sha = FALSE, remotes = c(slug))
          }
        }
      }
    }
  )
)

step_install_remote_binaries <- function() {
  InstallRemoteBinaries$new()
}

get_stage("before_install") %>%
add_step(step_install_remote_binaries())
neuroconductor/fmri documentation built on May 20, 2021, 4:28 p.m.