Add aqua tool installer cli (#889)

* Add aqua cli

* Move aqua cli to generic.rs

* Add a dry-run support to aqua

* style: format code

---------

Co-authored-by: Steve Lau <stevelauc@outlook.com>
This commit is contained in:
Boris Smidt
2024-08-20 03:18:27 +02:00
committed by GitHub
parent a2375b4820
commit e91c00c9c0
3 changed files with 16 additions and 0 deletions

View File

@@ -53,6 +53,7 @@ pub enum Step {
AppMan,
Asdf,
Atom,
Aqua,
Audit,
AutoCpufreq,
Bin,

View File

@@ -420,6 +420,7 @@ fn run() -> Result<()> {
})?;
runner.execute(Step::Poetry, "Poetry", || generic::run_poetry(&ctx))?;
runner.execute(Step::Zvm, "ZVM", || generic::run_zvm(&ctx))?;
runner.execute(Step::Aqua, "aqua", || generic::run_aqua(&ctx))?;
if should_run_powershell {
runner.execute(Step::Powershell, "Powershell Modules Update", || {

View File

@@ -224,6 +224,20 @@ pub fn run_apm(ctx: &ExecutionContext) -> Result<()> {
.status_checked()
}
pub fn run_aqua(ctx: &ExecutionContext) -> Result<()> {
let aqua = require("aqua")?;
print_separator("Aqua");
if ctx.run_type().dry() {
println!("Updating aqua ...");
println!("Updating aqua installed cli tools ...");
Ok(())
} else {
ctx.run_type().execute(&aqua).arg("update-aqua").status_checked()?;
ctx.run_type().execute(&aqua).arg("update").status_checked()
}
}
pub fn run_rustup(ctx: &ExecutionContext) -> Result<()> {
let rustup = require("rustup")?;