Support pkgin (fix #748)

This commit is contained in:
Roey Darwish Dror
2021-09-02 06:14:56 +03:00
parent 497fc4f97e
commit 611f69646e
3 changed files with 20 additions and 0 deletions

View File

@@ -98,6 +98,7 @@ pub enum Step {
Pipx,
Pip3,
Pkg,
Pkgin,
Pnpm,
Powershell,
Raco,

View File

@@ -173,6 +173,7 @@ fn run() -> Result<()> {
runner.execute(Step::Nix, "nix", || unix::run_nix(&ctx))?;
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))?;
}
#[cfg(target_os = "dragonfly")]

View File

@@ -100,6 +100,24 @@ pub fn run_oh_my_fish(ctx: &ExecutionContext) -> Result<()> {
ctx.run_type().execute(&fish).args(&["-c", "omf update"]).check_run()
}
pub fn run_pkgin(ctx: &ExecutionContext) -> Result<()> {
let pkgin = require("pkgin")?;
let mut command = ctx.run_type().execute(ctx.sudo().as_ref().unwrap());
command.arg(&pkgin).arg("update");
if ctx.config().yes() {
command.arg("-y");
}
command.check_run()?;
let mut command = ctx.run_type().execute(ctx.sudo().as_ref().unwrap());
command.arg(&pkgin).arg("upgrade");
if ctx.config().yes() {
command.arg("-y");
}
command.check_run()
}
pub fn run_fish_plug(ctx: &ExecutionContext) -> Result<()> {
let fish = require("fish")?;
ctx.base_dirs()