intermodal/bin/gen/src/command_ext.rs
Casey Rodarmor 43788cac9a
Fix bin/package
Also, To more easily test the `bin/package` script, build and publish
packages for all tags, not just those that start with `v`.

type: fixed
2020-04-23 01:20:24 -07:00

25 lines
414 B
Rust

use crate::common::*;
pub(crate) trait CommandExt {
#[throws]
fn out(&mut self) -> String;
}
impl CommandExt for Command {
#[throws]
fn out(&mut self) -> String {
info!("Running {:?}…", self);
let output = self
.stdout(Stdio::piped())
.stderr(Stdio::inherit())
.output()?;
output.status.into_result()?;
let text = String::from_utf8(output.stdout)?;
text
}
}