Captures the expression and executes it when running the step.
An optional preparatory expression can be provided that is executed
during preparation.
If the top-level expression is a qualified function call (of the format
package::fun()), the package is installed during preparation.
Examples
dsl_init()
#> ✔ Creating a clean tic stage configuration
#> ℹ See `?tic::dsl_get` for details
get_stage("install") %>%
add_step(step_run_code(update.packages(ask = FALSE)))
#> Superclass TicStep has cloneable=FALSE, but subclass RunCode has cloneable=TRUE. A subclass cannot be cloneable when its superclass is not cloneable, so cloning will be disabled for RunCode.
# Will install covr from CRAN during preparation:
get_stage("after_success") %>%
add_code_step(covr::codecov())
#> Superclass TicStep has cloneable=FALSE, but subclass RunCode has cloneable=TRUE. A subclass cannot be cloneable when its superclass is not cloneable, so cloning will be disabled for RunCode.
dsl_get()
#> ── tic configuration summary ───────────────────────────────────────────────────
#> ── Stage: install ──────────────────────────────────────────────────────────────
#> ▶ step_run_code(update.packages(ask=FALSE))
#> ── Stage: after_success ────────────────────────────────────────────────────────
#> ▶ step_run_code(covr::codecov())
