Fix composer output (fix #402) (#404)

This commit is contained in:
Roey Darwish Dror
2020-05-11 06:23:43 +03:00
committed by GitHub
parent 9f8fbf6d65
commit ca62fbcb91

View File

@@ -215,8 +215,16 @@ pub fn run_composer_update(ctx: &ExecutionContext) -> Result<()> {
} }
} }
let output = Command::new(&composer).args(&["global", "update"]).check_output()?; let output = Command::new(&composer).args(&["global", "update"]).output()?;
if output.contains("valet") { let status = output.status;
if !status.success() {
return Err(TopgradeError::ProcessFailed(status).into());
}
let stdout = String::from_utf8(output.stdout)?;
let stderr = String::from_utf8(output.stderr)?;
print!("{}\n{}", stdout, stderr);
if stdout.contains("valet") || stderr.contains("valet") {
if let Some(valet) = utils::which("valet") { if let Some(valet) = utils::which("valet") {
ctx.run_type().execute(&valet).arg("install").check_run()?; ctx.run_type().execute(&valet).arg("install").check_run()?;
} }