-
Notifications
You must be signed in to change notification settings - Fork 203
feat(adless): add adless step #1372
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
base: main
Are you sure you want to change the base?
Conversation
|
Note, I've also banned Command::new() which was part of issue 1227 and I am continuing work on it |
Please don't mix PRs. Can you separate them? Also please don't run |
- Add new adless step module with sudo execution - Integrate adless into Step enum and default steps - Support Windows, Linux, and macOS platforms Closes topgrade-rs#1334
|
Make sure to put the issue tag directly after the keyword (fixes), otherwise GitHub won't recognize it |
| #[cfg(target_os = "linux")] | ||
| runner.execute(*self, "toolbx", || toolbx::run_toolbx(ctx))? | ||
| } | ||
| Typst => runner.execute(*self, "Typst", || generic::run_typst(ctx))?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad rebase
| use crate::command::CommandExt; | ||
| use crate::execution_context::ExecutionContext; | ||
| use crate::terminal::print_separator; | ||
| use crate::utils::require; | ||
| use color_eyre::eyre::Result; | ||
|
|
||
| /// Update Adless hosts list using `sudo adless update` | ||
| pub fn run_adless(ctx: &ExecutionContext) -> Result<()> { | ||
| let adless = require("adless")?; | ||
|
|
||
| print_separator("Adless"); | ||
|
|
||
| let sudo = ctx.require_sudo()?; | ||
| sudo.execute(ctx, &adless)?.arg("update").status_checked() | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of putting adless in it's own file (steps/adless.rs), put it into the file matching its OS. For this one, that's os/unix.rs.
| #[cfg(target_os = "linux")] | ||
| runner.execute(*self, "am", || linux::run_am(ctx))? | ||
| } | ||
| Adless => runner.execute(*self, "adless", || adless::run_adless(ctx))?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to add cfg(unix) here; see also Tmux for example.
Fixes #1334 Support for Adless (Not yet tested)
Requires someone with adless to test it