run {cargo} | R Documentation |
Run Cargo
Description
This function runs Cargo (Rust's package manager) with the ...
arguments passed as command line arguments.
Usage
run(
...,
minimum_version = ".",
search_methods = c("cache", "convention", "path"),
leave_no_trace = FALSE,
environment_variables = list(),
rustflags = NULL,
verbose = TRUE,
run_twice = FALSE,
stdout = "",
stderr = ""
)
Arguments
... |
Character vector of command line arguments passed to the
|
minimum_version |
A character string representing the minimum version of
Rust that is needed. Or a path to the root of a package (i.e., the
directory containing the DESCRIPTION file), in which case the value is
found from the field: |
search_methods |
A character vector potentially containing values
|
leave_no_trace |
If |
environment_variables |
A named character vector providing environment
variables which should be temporarily set while running Cargo. Note that
the |
rustflags |
A character vector from which the
|
verbose |
If |
run_twice |
Should the cargo command be run twice? The environment
variable |
stdout |
See argument of the same name in |
stderr |
See argument of the same name in |
Value
The same value and behavior as the base::system2()
function, except
a non-zero exit code will be given in Cargo is not found.
Examples
if (run("--version") != 0) {
message("Cargo is not installed. Please run cargo::install() in an interactive session.")
}