Extra options for distrobox (#83)

This commit is contained in:
LeSnake04
2022-10-28 00:29:35 +02:00
committed by GitHub
parent 6a3de81f1f
commit bf7f9a64ee
3 changed files with 47 additions and 9 deletions

View File

@@ -607,14 +607,26 @@ pub fn run_protonup_update(ctx: &ExecutionContext) -> Result<()> {
}
pub fn run_distrobox_update(ctx: &ExecutionContext) -> Result<()> {
let distrobox = require("distrobox")?;
print_separator("distrobox");
ctx.run_type()
.execute(distrobox)
.args(&["upgrade", "--all"])
.check_run()
print_separator("Distrobox");
match (
match (
ctx.run_type().execute("distrobox").arg("upgrade"),
ctx.config().distrobox_containers(),
) {
(r, Some(c)) => {
if c.is_empty() {
return Err(SkipStep("You need to specify at least one container".to_string()).into());
}
r.args(c)
}
(r, None) => r.arg("--all"),
},
ctx.config().distrobox_root(),
) {
(r, true) => r.arg("--root"),
(r, false) => r,
}
.check_run()
}
pub fn run_config_update(ctx: &ExecutionContext) -> Result<()> {