Only run "valet install" if valet was updated (#315)

This commit is contained in:
Morten Scheel
2020-02-10 21:10:06 +01:00
committed by GitHub
parent d72a17b1dc
commit c3b8449eb7
3 changed files with 10 additions and 5 deletions

View File

@@ -29,6 +29,7 @@ pub enum Step {
Emacs,
Gem,
Node,
Composer,
Sdkman,
Remotes,
Rustup,

View File

@@ -306,9 +306,12 @@ fn run() -> Result<()> {
if config.should_run(Step::Node) {
runner.execute("NPM", || node::run_npm_upgrade(&base_dirs, run_type))?;
runner.execute("composer", || generic::run_composer_update(&base_dirs, run_type))?;
runner.execute("yarn", || node::yarn_global_update(run_type))?;
}
if config.should_run(Step::Composer) {
runner.execute("composer", || generic::run_composer_update(&base_dirs, run_type))?;
}
#[cfg(not(any(
target_os = "freebsd",

View File

@@ -187,10 +187,11 @@ pub fn run_composer_update(base_dirs: &BaseDirs, run_type: RunType) -> Result<()
print_separator("Composer");
run_type.execute(&composer).args(&["global", "update"]).check_run()?;
if let Some(valet) = utils::which("valet") {
run_type.execute(&valet).arg("install").check_run()?;
let output = Command::new(&composer).args(&["global", "update"]).check_output()?;
if output.contains("valet") {
if let Some(valet) = utils::which("valet") {
run_type.execute(&valet).arg("install").check_run()?;
}
}
Ok(())