| validate_command_available | R Documentation |
Shared pattern: resolve a command, abort if not found, run it with a version flag, abort if execution fails. Returns the resolved command.
validate_command_available(
command_resolver,
not_found,
label = "Command",
version_arg = "--version"
)
command_resolver |
Function returning the command path or NULL. |
not_found |
Character vector passed to cli::cli_abort when the command is not found. Use "i" = "..." entries for install hints. |
label |
Character string used in the generic "found but failed" message. Defaults to "Command". |
version_arg |
Character. Argument used to check the command runs. Defaults to "–version". |
Invisibly returns the resolved command path.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.