Skip to content

Commit fc1014d

Browse files
authored
Merge pull request #384 from cmu-delphi/simplify-workflow-partial
Simplify workflow partial
2 parents 79ec616 + df03b97 commit fc1014d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

R/epi_recipe.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,13 @@ print.epi_recipe <- function(x, form_width = 30, ...) {
298298
o[2] <- paste0(rr[1], "Epi Recipe", h1_tail)
299299

300300
# Number the operations
301-
ops <- seq(grep(" Operations ", o, fixed = TRUE) + 1, length(o))
302-
rep_ops <- sub("\033[36m•\033[39m ", "", o[ops], fixed = TRUE) # kills the •
303-
o[ops] <- paste0(ops - ops[1] + 1, ". ", rep_ops)
301+
has_operations <- any(grepl(" Operations ", o, fixed = TRUE))
302+
if (has_operations) {
303+
ops <- seq(grep(" Operations ", o, fixed = TRUE) + 1, length(o))
304+
# kills the \bullet
305+
rep_ops <- sub("^\\033\\[36m.\\033\\[39m ", "", o[ops], perl = TRUE)
306+
o[ops] <- paste0(ops - ops[1] + 1, ". ", rep_ops)
307+
}
304308
cli::cli_bullets(o)
305309
invisible(x)
306310
}

0 commit comments

Comments
 (0)