assert_cli | R Documentation |
Asserts that a command-line interface (CLI) tool is found on the system's
PATH
and returns the executable's filesystem path.
assert_cli(
cmd,
error_msg =
paste0("The {.strong {cmd}} executable is required but couldn't be found on ",
"system's {.href [PATH](https://en.wikipedia.org/wiki/PATH_(variable))}."),
force_which = FALSE
)
cmd |
System command to invoke the CLI tool. A character scalar. |
error_msg |
Error message to print in case |
force_which |
If set to |
If the CLI tool is available on the system's PATH
, its filesystem path, invisibly. Otherwise, an error is thrown.
Other system interaction functions:
path_script()
,
test_cli()
Other functions extending the checkmate package:
assert_class_any()
,
assert_df_or_tibble()
,
assert_inf_count()
pal::assert_cli("Rscript")
cmd <- ifelse(checkmate::test_os("windows"), "pandoc.exe", "pandoc")
pal::assert_cli(cmd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.