diff --git a/src/executor.rs b/src/executor.rs index fedb6823..400d585d 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -236,6 +236,7 @@ impl Check for ExecutorExitStatus { pub trait CommandExt { /// Run the command, wait for it to complete, check the return code and decode the output as UTF-8. fn check_output(&mut self) -> Result; + fn string_output(&mut self) -> Result; } impl CommandExt for Command { @@ -248,4 +249,10 @@ impl CommandExt for Command { } Ok(String::from_utf8(output.stdout)?) } + + fn string_output(&mut self) -> Result { + let output = self.output()?; + trace!("Output of {:?}: {:?}", self, output); + Ok(String::from_utf8(output.stdout)?) + } } diff --git a/src/steps/node.rs b/src/steps/node.rs index 3ad67ad0..729dee8a 100644 --- a/src/steps/node.rs +++ b/src/steps/node.rs @@ -53,7 +53,7 @@ pub fn run_npm_upgrade(_base_dirs: &BaseDirs, run_type: RunType) -> Result<()> { pub fn yarn_global_update(run_type: RunType) -> Result<()> { let yarn = require("yarn")?; - let output = Command::new(&yarn).arg("version").check_output()?; + let output = Command::new(&yarn).arg("version").string_output()?; if output.contains("Hadoop") { debug!("Yarn is Hadoop yarn"); return Err(SkipStep.into());