From f51a26494dc19a892a3433ef04dfb351c1631692 Mon Sep 17 00:00:00 2001 From: Jonathan Dahan Date: Thu, 5 Sep 2019 13:38:45 -0400 Subject: [PATCH] Create Shell step for various shell utilities (#217) --- src/config.rs | 3 +++ src/main.rs | 62 ++++++++++++++++++++++++++------------------------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/src/config.rs b/src/config.rs index c1e79764..da2ae152 100644 --- a/src/config.rs +++ b/src/config.rs @@ -33,6 +33,7 @@ lazy_static! { m.insert("remotes", Step::Remotes); m.insert("rustup", Step::Rustup); m.insert("cargo", Step::Cargo); + m.insert("shell", Step::Shell); #[cfg(windows)] m.insert("powershell", Step::Powershell); @@ -65,6 +66,8 @@ pub enum Step { /// Don't run Cargo Cargo, /// Don't update Powershell modules + Shell, + /// Don't run shell updates (zplug, zr, oh-my-zsh, fisher, tmux) Powershell, } diff --git a/src/main.rs b/src/main.rs index 6a8deb7b..ba2c8058 100644 --- a/src/main.rs +++ b/src/main.rs @@ -260,36 +260,38 @@ fn run() -> Result<(), Error> { #[cfg(unix)] { - execute( - &mut report, - "zr", - || unix::run_zr(&base_dirs, run_type), - config.no_retry(), - )?; - execute( - &mut report, - "zplug", - || unix::run_zplug(&base_dirs, run_type), - config.no_retry(), - )?; - execute( - &mut report, - "oh-my-zsh", - || unix::run_oh_my_zsh(run_type), - config.no_retry(), - )?; - execute( - &mut report, - "fisher", - || unix::run_fisher(&base_dirs, run_type), - config.no_retry(), - )?; - execute( - &mut report, - "tmux", - || tmux::run_tpm(&base_dirs, run_type), - config.no_retry(), - )?; + if config.should_run(Step::Shell) { + execute( + &mut report, + "zr", + || unix::run_zr(&base_dirs, run_type), + config.no_retry(), + )?; + execute( + &mut report, + "zplug", + || unix::run_zplug(&base_dirs, run_type), + config.no_retry(), + )?; + execute( + &mut report, + "oh-my-zsh", + || unix::run_oh_my_zsh(run_type), + config.no_retry(), + )?; + execute( + &mut report, + "fisher", + || unix::run_fisher(&base_dirs, run_type), + config.no_retry(), + )?; + execute( + &mut report, + "tmux", + || tmux::run_tpm(&base_dirs, run_type), + config.no_retry(), + )?; + } } if config.should_run(Step::Rustup) {