From bfddf76f7ab08bca360341d458a357dbc8969aac Mon Sep 17 00:00:00 2001 From: jtrv Date: Thu, 30 May 2024 13:29:56 -0700 Subject: [PATCH] feat: add support for bun completions --- src/config.rs | 1 + src/main.rs | 3 +++ src/steps/os/unix.rs | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/src/config.rs b/src/config.rs index c172c56d..6ca74bf0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -61,6 +61,7 @@ pub enum Step { BrewFormula, Bun, BunPackages, + BunCompletions, Cargo, Certbot, Chezmoi, diff --git a/src/main.rs b/src/main.rs index e80e0df9..ec5631a2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -303,6 +303,9 @@ fn run() -> Result<()> { runner.execute(Step::Pkgin, "pkgin", || unix::run_pkgin(&ctx))?; runner.execute(Step::Bun, "bun", || unix::run_bun(&ctx))?; runner.execute(Step::BunPackages, "bun-packages", || unix::run_bun_packages(&ctx))?; + runner.execute(Step::BunCompletions, "bun-completions", || { + unix::run_bun_completions(&ctx) + })?; runner.execute(Step::Shell, "zr", || zsh::run_zr(&ctx))?; runner.execute(Step::Shell, "antibody", || zsh::run_antibody(&ctx))?; runner.execute(Step::Shell, "antidote", || zsh::run_antidote(&ctx))?; diff --git a/src/steps/os/unix.rs b/src/steps/os/unix.rs index 7e08d6a0..5e6f857f 100644 --- a/src/steps/os/unix.rs +++ b/src/steps/os/unix.rs @@ -701,6 +701,14 @@ pub fn run_bun_packages(ctx: &ExecutionContext) -> Result<()> { ctx.run_type().execute(bun).args(["-g", "update"]).status_checked() } +pub fn run_bun_completions(ctx: &ExecutionContext) -> Result<()> { + let bun = require("bun")?; + + print_separator("Bun Completions"); + + ctx.run_type().execute(bun).args(["completions"]).status_checked() +} + /// Update dotfiles with `rcm(7)`. /// /// See: