MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / run

Function run

vmm/build.rs:135–152  ·  view source on GitHub ↗
(
    program: &str,
    args: &[&str],
    cwd: &Path,
    envs: &[(&str, &str)],
    what: &str,
)

Source from the content-addressed store, hash-verified

133}
134
135fn run(
136 program: &str,
137 args: &[&str],
138 cwd: &Path,
139 envs: &[(&str, &str)],
140 what: &str,
141) -> Result<(), Box<dyn std::error::Error>> {
142 let mut command = Command::new(program);
143 command
144 .current_dir(cwd)
145 .args(args)
146 .envs(envs.iter().copied());
147 let status = command.status()?;
148 if !status.success() {
149 return Err(format!("{what} failed with exit status {status}").into());
150 }
151 Ok(())
152}
153
154fn npm_cmd() -> &'static str {
155 if cfg!(windows) {

Callers 1

build_consoleFunction · 0.70

Calls 1

statusMethod · 0.45

Tested by

no test coverage detected