MCPcopy Index your code
hub / github.com/RustPython/RustPython / command

Function command

crates/vm/build.rs:66–74  ·  view source on GitHub ↗
(cmd: impl AsRef<std::ffi::OsStr>, args: &[&str])

Source from the content-addressed store, hash-verified

64}
65
66fn command(cmd: impl AsRef<std::ffi::OsStr>, args: &[&str]) -> String {
67 match Command::new(cmd).args(args).output() {
68 Ok(output) => match String::from_utf8(output.stdout) {
69 Ok(s) => s,
70 Err(err) => format!("(output error: {err})"),
71 },
72 Err(err) => format!("(command error: {err})"),
73 }
74}

Callers 3

maybe_run_commandFunction · 0.85
gitFunction · 0.85
rustc_versionFunction · 0.85

Calls 3

newFunction · 0.85
outputMethod · 0.45
argsMethod · 0.45

Tested by

no test coverage detected