diff --git a/src/config.rs b/src/config.rs index 99d0a516..1e6798dc 100644 --- a/src/config.rs +++ b/src/config.rs @@ -189,6 +189,7 @@ pub struct ConfigFile { cleanup: Option, notify_each_step: Option, accept_all_windows_updates: Option, + bashit_branch: Option, only: Option>, composer: Option, brew: Option, @@ -528,6 +529,12 @@ impl Config { self.config_file.assume_yes.unwrap_or(self.opt.yes) } + /// Bash-it branch + #[allow(dead_code)] + pub fn bashit_branch(&self) -> &str { + self.config_file.bashit_branch.as_deref().unwrap_or("stable") + } + /// Whether to accept all Windows updates #[allow(dead_code)] pub fn accept_all_windows_updates(&self) -> bool { diff --git a/src/main.rs b/src/main.rs index e506b55c..20ffa992 100644 --- a/src/main.rs +++ b/src/main.rs @@ -257,6 +257,7 @@ fn run() -> Result<()> { runner.execute(Step::Shell, "zim", || zsh::run_zim(&base_dirs, run_type))?; runner.execute(Step::Shell, "oh-my-zsh", || zsh::run_oh_my_zsh(&ctx))?; runner.execute(Step::Shell, "fisher", || unix::run_fisher(&base_dirs, run_type))?; + runner.execute(Step::Shell, "bash-it", || unix::run_bashit(&ctx))?; runner.execute(Step::Shell, "oh-my-fish", || unix::run_oh_my_fish(&ctx))?; runner.execute(Step::Tmux, "tmux", || tmux::run_tpm(&base_dirs, run_type))?; runner.execute(Step::Tldr, "TLDR", || unix::run_tldr(run_type))?; diff --git a/src/steps/os/unix.rs b/src/steps/os/unix.rs index f8122832..061a4520 100644 --- a/src/steps/os/unix.rs +++ b/src/steps/os/unix.rs @@ -77,6 +77,17 @@ pub fn run_fisher(base_dirs: &BaseDirs, run_type: RunType) -> Result<()> { run_type.execute(&fish).args(&["-c", "fisher update"]).check_run() } +pub fn run_bashit(ctx: &ExecutionContext) -> Result<()> { + ctx.base_dirs().home_dir().join(".bash_it").require()?; + + print_separator("Bash-it"); + + ctx.run_type() + .execute("bash") + .args(&["-lc", &format!("bash-it update {}", ctx.config().bashit_branch())]) + .check_run() +} + pub fn run_oh_my_fish(ctx: &ExecutionContext) -> Result<()> { let fish = require("fish")?; ctx.base_dirs()