diff options
Diffstat (limited to 'xtask/src/cmd.rs')
-rw-r--r-- | xtask/src/cmd.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xtask/src/cmd.rs b/xtask/src/cmd.rs index 2027f4893..37497fb74 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,11 @@ pub fn run(cmdline: &str, dir: &str) -> Result<()> { | |||
34 | .map(|_| ()) | 34 | .map(|_| ()) |
35 | } | 35 | } |
36 | 36 | ||
37 | pub fn run_with_output(cmdline: &str, dir: &str) -> Result<Output> { | 37 | pub 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 | let stdout = stdout.trim().to_string(); | ||
41 | Ok(stdout) | ||
39 | } | 42 | } |
40 | 43 | ||
41 | fn do_run(cmdline: &str, dir: &str, f: &mut dyn FnMut(&mut Command)) -> Result<Output> { | 44 | fn do_run(cmdline: &str, dir: &str, f: &mut dyn FnMut(&mut Command)) -> Result<Output> { |