aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/cmd.rs
diff options
context:
space:
mode:
Diffstat (limited to 'xtask/src/cmd.rs')
-rw-r--r--xtask/src/cmd.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/xtask/src/cmd.rs b/xtask/src/cmd.rs
index 2027f4893..8e08a929b 100644
--- a/xtask/src/cmd.rs
+++ b/xtask/src/cmd.rs
@@ -18,7 +18,7 @@ impl Cmd<'_> {
18 run(self.unix, self.work_dir) 18 run(self.unix, self.work_dir)
19 } 19 }
20 } 20 }
21 pub fn run_with_output(self) -> Result<Output> { 21 pub fn run_with_output(self) -> Result<String> {
22 if cfg!(windows) { 22 if cfg!(windows) {
23 run_with_output(self.windows, self.work_dir) 23 run_with_output(self.windows, self.work_dir)
24 } else { 24 } else {
@@ -34,8 +34,10 @@ pub fn run(cmdline: &str, dir: &str) -> Result<()> {
34 .map(|_| ()) 34 .map(|_| ())
35} 35}
36 36
37pub fn run_with_output(cmdline: &str, dir: &str) -> Result<Output> { 37pub fn run_with_output(cmdline: &str, dir: &str) -> Result<String> {
38 do_run(cmdline, dir, &mut |_| {}) 38 let output = do_run(cmdline, dir, &mut |_| {})?;
39 let stdout = String::from_utf8(output.stdout)?;
40 Ok(stdout)
39} 41}
40 42
41fn do_run(cmdline: &str, dir: &str, f: &mut dyn FnMut(&mut Command)) -> Result<Output> { 43fn do_run(cmdline: &str, dir: &str, f: &mut dyn FnMut(&mut Command)) -> Result<Output> {