feat(adless): add adless step#1372
Open
Prajwal-k-tech wants to merge 1 commit intotopgrade-rs:mainfrom
Open
Conversation
Author
|
Note, I've also banned Command::new() which was part of issue 1227 and I am continuing work on it |
Member
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
Member
|
Make sure to put the issue tag directly after the keyword (fixes), otherwise GitHub won't recognize it |
GideonBear
requested changes
Oct 27, 2025
| #[cfg(target_os = "linux")] | ||
| runner.execute(*self, "toolbx", || toolbx::run_toolbx(ctx))? | ||
| } | ||
| Typst => runner.execute(*self, "Typst", || generic::run_typst(ctx))?, |
Comment on lines
+1
to
+15
| 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() | ||
| } |
Member
There was a problem hiding this comment.
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))?, |
Member
There was a problem hiding this comment.
Make sure to add cfg(unix) here; see also Tmux for example.
barkleesanders
added a commit
to barkleesanders/topgrade
that referenced
this pull request
Mar 8, 2026
From PR topgrade-rs#1372 by Prajwal-k-tech. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1334 Support for Adless (Not yet tested)
Requires someone with adless to test it