Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support auto-cpufreq #800

Merged
merged 1 commit into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
})?;
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))?;

Check warning on line 238 in src/main.rs

View check run for this annotation

Codecov / codecov/patch

src/main.rs#L238

Added line #L238 was not covered by tests
}

#[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 @@
.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")?;

Check warning on line 1067 in src/steps/os/linux.rs

View check run for this annotation

Codecov / codecov/patch

src/steps/os/linux.rs#L1065-L1067

Added lines #L1065 - L1067 were not covered by tests

print_separator("auto-cpufreq");

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

Check warning on line 1077 in src/steps/os/linux.rs

View check run for this annotation

Codecov / codecov/patch

src/steps/os/linux.rs#L1069-L1077

Added lines #L1069 - L1077 were not covered by tests
#[cfg(test)]
mod tests {
use super::*;
Expand Down
Loading