Skip to content

Commit

Permalink
feat: support auto-cpufreq (topgrade-rs#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLauC authored May 18, 2024
1 parent 2a1999f commit f661f00
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub enum Step {
Asdf,
Atom,
Audit,
AutoCpufreq,
Bin,
Bob,
BrewCask,
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ fn run() -> Result<()> {
})?;
runner.execute(Step::Lure, "LURE", || linux::run_lure_update(&ctx))?;
runner.execute(Step::Waydroid, "Waydroid", || linux::run_waydroid(&ctx))?;
runner.execute(Step::AutoCpufreq, "auto-cpufreq", || linux::run_auto_cpufreq(&ctx))?;
}

#[cfg(target_os = "macos")]
Expand Down
13 changes: 13 additions & 0 deletions src/steps/os/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,19 @@ pub fn run_waydroid(ctx: &ExecutionContext) -> Result<()> {
.status_checked()
}

pub fn run_auto_cpufreq(ctx: &ExecutionContext) -> Result<()> {
let sudo = require_option(ctx.sudo().as_ref(), REQUIRE_SUDO.to_string())?;
let auto_cpu_freq = require("auto-cpufreq")?;

print_separator("auto-cpufreq");

ctx.run_type()
.execute(sudo)
.arg(auto_cpu_freq)
.arg("--update")
.status_checked()
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit f661f00

Please sign in to comment.