Nothing
#' Generate report on package compliance with rOpenSci Statistical Software
#' requirements as background process
#'
#' @param path Path to local repository
#' @return A \pkg{processx} object connecting to the background process
#' generating the main \link{pkgcheck} results (see Note).
#'
#' @note The return object will by default display whether it is still running,
#' or whether it has finished. Once it has finished, the results can be obtained
#' by calling `$get_result()`, or the main \link{pkgcheck} function can be
#' called to quickly retrieve the main results from local cache.
#'
#' @note This function does not accept the `extra_env` parameter of the main
#' \link{pkgcheck} function, and can not be used to run extra, locally-defined
#' checks.
#' @family pkgcheck_fns
#' @export
#' @examples
#' f <- system.file ("extdata", "pkgstats_9.9.tar.gz", package = "pkgstats")
#' path <- pkgstats::extract_tarball (f)
#'
#' \dontrun{
#' # Foreground checks as "blocking" process which will return
#' # only after all checks have finished:
#' checks <- pkgcheck (path)
#'
#' # Or run process in background, do other things in the meantime,
#' # and obtain checks once they have finished:
#' ps <- pkgcheck_bg (path)
#' ps # print status to screen, same as 'ps$print()'
#' # Once finished, 'pkgcheck' results can be extracted with:
#' checks <- ps$get_result ()
#' }
#' fs::dir_delete (path)
pkgcheck_bg <- function (path) {
requireNamespace ("callr", quietly = TRUE)
logfiles <- logfile_names (path)
stopfile <- gsub (
"\\_stdout$", "_stop",
logfiles$stdout
)
if (file.exists (stopfile)) {
file.remove (stopfile)
}
e <- c (callr::rcmd_safe_env (),
"PKGCHECK_PXBG_STOP" = stopfile,
"PKGCHECK_BG" = TRUE,
"PKGCHECK_CACHE_DIR" = Sys.getenv ("PKGCHECK_CACHE_DIR")
)
Sys.setenv ("PKGCHECK_PXBG_STOP" = stopfile)
callr::r_bg (
func = pkgcheck::pkgcheck,
args = list (path = path),
stdout = logfiles$stdout,
stderr = logfiles$stderr,
env = e,
package = TRUE
)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.