Showing 1 of 2 files from the diff.

@@ -7,21 +7,27 @@
Loading
7 7
#' requirements for the queried operating system.
8 8
#'
9 9
#' @inheritParams local_install
10 -
#' @param os,os_release The operating system and operating system release version, see
11 -
#'   <https://github.com/rstudio/r-system-requirements#operating-systems> for the
12 -
#'   list of supported operating systems. If `NULL`, the default, these will be
13 -
#'   looked up using [distro::distro()].
10 +
#' @param os,os_release The operating system and operating system release
11 +
#'   version, e.g. "ubuntu", "debian", "centos", "redhat". See
12 +
#'   <https://github.com/rstudio/r-system-requirements#operating-systems> for
13 +
#'   all full list of supported operating systems.
14 +
#'
15 +
#'   If `NULL`, the default, these will be looked up using [distro::distro()].
14 16
#' @param execute,sudo If `execute` is `TRUE`, pak will execute the system
15 17
#'   commands (if any). If `sudo` is `TRUE`, pak will prepend the commands with
16 18
#'   [sudo](https://en.wikipedia.org/wiki/Sudo).
17 19
#' @param echo If `echo` is `TRUE` and `execute` is `TRUE`, echo the command output.
18 -
#' @return A character vector of commands needed to install the system requirements for the package (invisibly).
20 +
#' @return A character vector of commands needed to install the system
21 +
#'   requirements for the package.
19 22
#' @export
23 +
#' @examples
24 +
#' pkg_system_requirements("pak", "ubuntu", "20.04")
25 +
#' pkg_system_requirements("pak", "redhat", "7")
20 26
local_system_requirements <- function(os = NULL, os_release = NULL, root = ".", execute = FALSE, sudo = execute, echo = FALSE) {
21 27
  res <- remote(
22 28
    function(...) asNamespace("pak")$system_requirements_internal(...),
23 29
    list(os = os, os_release = os_release, root = root, package = NULL, execute = execute, sudo = sudo, echo = echo))
24 -
  invisible(res)
30 +
  if (execute) invisible(res) else res
25 31
}
26 32
27 33
#' @param package The package name to lookup system requirements for.
@@ -31,7 +37,7 @@
Loading
31 37
  res <- remote(
32 38
    function(...) asNamespace("pak")$system_requirements_internal(...),
33 39
    list(os = os, os_release = os_release, root = NULL, package = package, execute = execute, sudo = sudo, echo = echo))
34 -
  invisible(res)
40 +
  if (execute) invisible(res) else res
35 41
}
36 42
37 43
system_requirements_internal <- function(os, os_release, root, package, execute, sudo, echo) {
Files Coverage
R 18.92%
Project Totals (23 files) 18.92%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
        informational: true
10
    patch:
11
      default:
12
        target: auto
13
        threshold: 1%
14
        informational: true
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading