#205 Automatically lookup the operating system and release version

Merged Jim Hester jimhester

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 1 of 3 files from the diff.
Other files ignored by Codecov

@@ -9,21 +9,28 @@
Loading
9 9
#' @inheritParams local_install
10 10
#' @param os,os_release The operating system and operating system release version, see
11 11
#'   <https://github.com/rstudio/r-system-requirements#operating-systems> for the
12 -
#'   list of supported operating systems.
12 +
#'   list of supported operating systems. If `NULL`, the default, these will be
13 +
#'   looked up using [distro::distro()].
13 14
#' @param execute,sudo If `execute` is `TRUE`, pak will execute the system
14 15
#'   commands (if any). If `sudo` is `TRUE`, pak will prepend the commands with
15 16
#'   [sudo](https://en.wikipedia.org/wiki/Sudo).
16 17
#' @param echo If `echo` is `TRUE` and `execute` is `TRUE`, echo the command output.
17 18
#' @return A character vector of commands needed to install the system requirements for the package (invisibly).
18 19
#' @export
19 -
local_system_requirements <- function(os, os_release, root = ".", execute = FALSE, sudo = execute, echo = FALSE) {
20 +
local_system_requirements <- function(os = NULL, os_release = NULL, root = ".", execute = FALSE, sudo = execute, echo = FALSE) {
20 21
  res <- remote(
21 22
    function(...) asNamespace("pak")$local_system_requirements_internal(...),
22 23
    list(os = os, os_release = os_release, root = root, execute = execute, sudo = sudo, echo = echo))
23 24
  invisible(res)
24 25
}
25 26
26 27
local_system_requirements_internal <- function(os, os_release, root, execute, sudo, echo) {
28 +
  if (is.null(os) || is.null(os_release)) {
29 +
    d <- distro::distro()
30 +
    os <- os %||% d$id
31 +
    os_release <- os_release %||% d$short_version
32 +
  }
33 +
27 34
  os_versions <- supported_os_versions()
28 35
29 36
  os <- match.arg(os, names(os_versions))

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R -0.12% 35.18%
Project Totals (16 files) 35.18%
Loading