feat: add support for bun (#7)

Authored-by: Matthieu Vion <contact@mvion.fr>
Approved-by: Thomas Schönauer <t.schoenauer@hgs-wt.at>
This commit is contained in:
DottoDev
2022-10-10 20:16:13 +00:00
committed by GitHub
parent aebf3f1594
commit 3f7614b885
4 changed files with 10 additions and 0 deletions

View File

@@ -71,6 +71,7 @@ pub enum Step {
Atom,
BrewCask,
BrewFormula,
Bun,
Bin,
Cargo,
Chezmoi,

View File

@@ -196,6 +196,7 @@ fn run() -> Result<()> {
runner.execute(Step::HomeManager, "home-manager", || unix::run_home_manager(run_type))?;
runner.execute(Step::Asdf, "asdf", || unix::run_asdf(run_type))?;
runner.execute(Step::Pkgin, "pkgin", || unix::run_pkgin(&ctx))?;
runner.execute(Step::Bun, "bun", || unix::run_bun(&ctx))?;
}
#[cfg(target_os = "dragonfly")]

0
src/steps/bun.rs Normal file
View File

View File

@@ -409,6 +409,14 @@ pub fn run_sdkman(base_dirs: &BaseDirs, cleanup: bool, run_type: RunType) -> Res
Ok(())
}
pub fn run_bun(ctx: &ExecutionContext) -> Result<()> {
let bun = require("bun")?;
print_separator("Bun");
ctx.run_type().execute(&bun).arg("upgrade").check_run()
}
pub fn reboot() {
print!("Rebooting...");
Command::new("sudo").arg("reboot").spawn().unwrap().wait().unwrap();