MCPcopy Create free account
hub / github.com/archlinux/alpm / ensure_success

Function ensure_success

dev-scripts/src/cmd.rs:6–19  ·  view source on GitHub ↗

Make sure a command finished successfully, otherwise throw an error.

(output: &Output, message: String)

Source from the content-addressed store, hash-verified

4
5/// Make sure a command finished successfully, otherwise throw an error.
6pub fn ensure_success(output: &Output, message: String) -> Result<(), Error> {
7 let stderr = String::from_utf8_lossy(&output.stderr).to_string();
8 let stdout = String::from_utf8_lossy(&output.stdout).to_string();
9
10 if !output.status.success() {
11 return Err(Error::CommandFailed {
12 message,
13 stdout,
14 stderr,
15 });
16 }
17
18 Ok(())
19}

Callers 9

update_or_cloneMethod · 0.85
warmup_ssh_sessionFunction · 0.85
update_repoFunction · 0.85
clone_repoFunction · 0.85
sync_remote_databasesMethod · 0.85
download_packagesMethod · 0.85
get_tar_file_listFunction · 0.85
extract_pkg_filesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected