enable_github_colors: Enable/disable Colors on GitHub Actions

View source: R/util.R

enable_github_colorsR Documentation

Enable/disable Colors on GitHub Actions

Description

This will set the envvar R_CLI_NUM_COLORS to n_colors within the scope of .local_envir. To avoid side effects through overriding crayon::has_color(), this function only works on_github().

Usage

enable_github_colors(
  n_colors = as.integer(256^3),
  .local_envir = parent.frame(),
  quiet = FALSE
)

disable_github_colors(.local_envir = parent.frame(), quiet = FALSE)

Arguments

n_colors

An integer giving the number of colors. Default 24bit.

.local_envir

⁠[environment]⁠
The environment to use for scoping.

quiet

Should messages be printed?

Value

Invisibly returns TRUE if enabling/disabling was successful, FALSE otherwise.

Examples

Sys.setenv(GITHUB_ACTIONS = "true")
enable_github_colors()
Sys.setenv(GITHUB_ACTIONS = "false")
enable_github_colors()

assignUser/octolog documentation built on June 4, 2023, 3:28 p.m.