Skip to content

Commit

Permalink
feat: add support for bun completions
Browse files Browse the repository at this point in the history
  • Loading branch information
jtrv committed May 31, 2024
1 parent c748bb5 commit bfddf76
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub enum Step {
BrewFormula,
Bun,
BunPackages,
BunCompletions,
Cargo,
Certbot,
Chezmoi,
Expand Down
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))?;
Expand Down
8 changes: 8 additions & 0 deletions src/steps/os/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://github.com/thoughtbot/rcm>
Expand Down

0 comments on commit bfddf76

Please sign in to comment.