Bun packages fixes (#617)

* fix running with --only

* fix error when no packages installed
This commit is contained in:
LeSnake
2023-11-22 23:36:00 +01:00
committed by GitHub
parent 810315b0e2
commit 3eb3867944
2 changed files with 6 additions and 1 deletions

View File

@@ -277,7 +277,7 @@ fn run() -> Result<()> {
runner.execute(Step::Asdf, "asdf", || unix::run_asdf(&ctx))?;
runner.execute(Step::Pkgin, "pkgin", || unix::run_pkgin(&ctx))?;
runner.execute(Step::Bun, "bun", || unix::run_bun(&ctx))?;
runner.execute(Step::Bun, "bun-packages", || unix::run_bun_packages(&ctx))?;
runner.execute(Step::BunPackages, "bun-packages", || unix::run_bun_packages(&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))?;

View File

@@ -560,6 +560,11 @@ pub fn run_bun_packages(ctx: &ExecutionContext) -> Result<()> {
print_separator("Bun Packages");
if !HOME_DIR.join(".bun/install/global/package.json").exists() {
println!("No global packages installed");
return Ok(());
}
ctx.run_type().execute(bun).args(["-g", "update"]).status_checked()
}