test_cli | R Documentation |
Tests whether a command-line interface (CLI) tool is found on the system's
PATH
and optionally returns the executable's filesystem path.
test_cli(cmd, get_cmd_path = FALSE, force_which = FALSE)
cmd |
System command to invoke the CLI tool. A character scalar. |
get_cmd_path |
Whether or not to return the filesystem path to the CLI tool. If |
force_which |
If set to |
A logical scalar if get_cmd_path = FALSE
, otherwise the filesystem path to the cmd
executable.
Other system interaction functions:
assert_cli()
,
path_script()
pal::test_cli("Rscript")
cmd <- ifelse(checkmate::test_os("windows"), "pandoc.exe", "pandoc")
pal::test_cli(cmd, get_cmd_path = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.