Skip to content

Commit

Permalink
Merge pull request #68 from nflverse/sitrep-coloring
Browse files Browse the repository at this point in the history
Use colored cat rules
  • Loading branch information
mrcaseb authored Nov 15, 2021
2 parents eaf3bf7 + 6ef2e51 commit 7eb4de2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- `nflverse_sitrep()` and `ffverse_sitrep()` give a minimal overview of the package dependencies (v1.1.1.01)
- Minimum R version bumped to R 3.6.0 - this is the minimum version required to read the [current RDS file-version](https://stat.ethz.ch/R-manual/R-devel/library/base/html/readRDS.html).
- `_sitrep()` fns receive a small print-related bugfix (v1.1.1.03)
- `_sitrep()` fns receive a small print-related bugfix and coloring improvement (v1.1.1.03)

---

Expand Down
8 changes: 5 additions & 3 deletions R/sitrep.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ ffverse_sitrep <- function(pkg = c("ffscrapr","ffsimulator","ffpros"),

s <- utils::sessionInfo(packages)

cli::cat_rule(cli::style_bold("System Info"))
cli::cat_rule(cli::style_bold("System Info"), col = cli::make_ansi_style("cyan"), line = 1)
cli::cat_bullet(glue::glue("{s$R.version$version.string} {cli::symbol$bullet} Running under: {s$running}"))

cli::cat_rule(cli::style_bold(paste0(header, "Packages")))
cli::cat_rule(cli::style_bold(paste0(header, "Packages")), col = cli::make_ansi_style("cyan"), line = 1)
packages <- unlist(lapply(s$otherPkgs,function(pkg) pkg$Package))
versions <- unlist(lapply(s$otherPkgs, function(pkg) pkg$Version))

Expand All @@ -69,7 +69,7 @@ ffverse_sitrep <- function(pkg = c("ffscrapr","ffsimulator","ffpros"),
# Exit here if we don't want recursive deps
if (isFALSE(recursive)) return(invisible(NULL))

cli::cat_rule(cli::style_bold(paste0(header, "Dependencies")))
cli::cat_rule(cli::style_bold(paste0(header, "Dependencies")), col = cli::make_ansi_style("cyan"), line = 1)

# The checks failed because the repo option is empty sometimes
# so we set it here to the rstudio mirror and restore the options
Expand Down Expand Up @@ -107,6 +107,8 @@ ffverse_sitrep <- function(pkg = c("ffscrapr","ffsimulator","ffpros"),

cat_packages(packages,versions)

cli::cat_rule(col = cli::make_ansi_style("cyan"), line = 1)

}

cat_packages <- function(packages,versions){
Expand Down

0 comments on commit 7eb4de2

Please sign in to comment.