|
|
|
@ -24,7 +24,24 @@ pub fn new_command(program: &str) -> Command { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Run the given command and return its stdout.
|
|
|
|
|
pub fn run(mut command: Command, command_name: &str) -> Result<String, Error> { |
|
|
|
|
pub fn run(mut command: Command, command_name: &str) -> Result<(), Error> { |
|
|
|
|
info!("Running {:?}", command); |
|
|
|
|
|
|
|
|
|
let status = command.status()?; |
|
|
|
|
|
|
|
|
|
if status.success() { |
|
|
|
|
Ok(()) |
|
|
|
|
} else { |
|
|
|
|
bail!( |
|
|
|
|
"failed to execute `{}`: exited with {}", |
|
|
|
|
command_name, |
|
|
|
|
status |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Run the given command and return its stdout.
|
|
|
|
|
pub fn run_capture_stdout(mut command: Command, command_name: &str) -> Result<String, Error> { |
|
|
|
|
info!("Running {:?}", command); |
|
|
|
|
|
|
|
|
|
let output = command |
|
|
|
|