Bash-it (fix #621) (#625)

This commit is contained in:
Roey Darwish Dror
2021-02-10 08:58:03 +02:00
committed by GitHub
parent 098b60ba38
commit 729b5b6cb4
3 changed files with 19 additions and 0 deletions

View File

@@ -189,6 +189,7 @@ pub struct ConfigFile {
cleanup: Option<bool>,
notify_each_step: Option<bool>,
accept_all_windows_updates: Option<bool>,
bashit_branch: Option<String>,
only: Option<Vec<Step>>,
composer: Option<Composer>,
brew: Option<Brew>,
@@ -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 {

View File

@@ -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))?;

View File

@@ -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()