| run_command_safe | R Documentation |
Wraps processx::run() with consistent error handling. Returns a list
with status, stdout, and stderr. Never throws: a command that cannot be
started, fails, or times out is reported as a non-zero status, so a
diagnostic probe cannot abort the calling session.
run_command_safe(command, args = character(), timeout = 30, env = NULL)
command |
Character command to run. |
args |
Character vector of arguments. |
timeout |
Numeric timeout in seconds. Default 30. |
env |
Environment for the child process. |
processx is used rather than base::system2() because a modified env is
honored on every platform (system2's env is a no-op on Windows for programs
like node and python), and arguments are passed as an argv array without
shell quoting.
List with status, stdout, stderr.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.