Fix yarn (fix #403)
This commit is contained in:
@@ -236,6 +236,7 @@ impl Check for ExecutorExitStatus {
|
|||||||
pub trait CommandExt {
|
pub trait CommandExt {
|
||||||
/// Run the command, wait for it to complete, check the return code and decode the output as UTF-8.
|
/// 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<String>;
|
fn check_output(&mut self) -> Result<String>;
|
||||||
|
fn string_output(&mut self) -> Result<String>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CommandExt for Command {
|
impl CommandExt for Command {
|
||||||
@@ -248,4 +249,10 @@ impl CommandExt for Command {
|
|||||||
}
|
}
|
||||||
Ok(String::from_utf8(output.stdout)?)
|
Ok(String::from_utf8(output.stdout)?)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn string_output(&mut self) -> Result<String> {
|
||||||
|
let output = self.output()?;
|
||||||
|
trace!("Output of {:?}: {:?}", self, output);
|
||||||
|
Ok(String::from_utf8(output.stdout)?)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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<()> {
|
pub fn yarn_global_update(run_type: RunType) -> Result<()> {
|
||||||
let yarn = require("yarn")?;
|
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") {
|
if output.contains("Hadoop") {
|
||||||
debug!("Yarn is Hadoop yarn");
|
debug!("Yarn is Hadoop yarn");
|
||||||
return Err(SkipStep.into());
|
return Err(SkipStep.into());
|
||||||
|
|||||||
Reference in New Issue
Block a user