diff --git a/src/main.rs b/src/main.rs index cc341ef5..01aa82e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -214,6 +214,11 @@ fn run() -> Result<(), Error> { } } + if let Some(yarn) = utils::which("yarn") { + terminal.print_separator("Yarn"); + yarn_global_update(&yarn).report("Yarn", &mut reports); + } + if let Some(apm) = utils::which("apm") { terminal.print_separator("Atom Package Manager"); run_apm(&apm).report("Atom Package Manager", &mut reports); diff --git a/src/steps.rs b/src/steps.rs index 1283adb4..a6c2528b 100644 --- a/src/steps.rs +++ b/src/steps.rs @@ -26,6 +26,16 @@ pub fn run_emacs(emacs: &PathBuf, init: &PathBuf) -> Result<(), failure::Error> Ok(()) } +pub fn yarn_global_update(yarn: &PathBuf) -> Result<(), failure::Error> { + Command::new(&yarn) + .args(&["global", "upgrade", "-s"]) + .spawn()? + .wait()? + .check()?; + + Ok(()) +} + pub fn run_apm(apm: &PathBuf) -> Result<(), failure::Error> { Command::new(&apm) .args(&["upgrade", "--confirm=false"])