use crate::Error;
use crate::error::ErrorInner;
pub async fn run_command(name: &str, command: &mut tokio::process::Command) -> Result<(), Error> {
let output = command.output()
.await
.map_err(|e| ErrorInner::RunCommand(name.to_owned(), e))?;
if output.status.success() {
Ok(())
} else {
Err(ErrorInner::CommandFailed(name.to_owned(), output).into())
}
}