Skip to content
Open
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
6 changes: 3 additions & 3 deletions src/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use crate::utils::hostname;
#[strum(serialize_all = "snake_case")]
pub enum Step {
AM,
Adless,
AndroidStudio,
AppMan,
Aqua,
Expand Down Expand Up @@ -149,7 +150,6 @@ pub enum Step {
Tlmgr,
Tmux,
Toolbx,
Typst,
Uv,
Vagrant,
Vcpkg,
Expand Down Expand Up @@ -182,6 +182,7 @@ impl Step {
#[cfg(target_os = "linux")]
runner.execute(*self, "am", || linux::run_am(ctx))?
}
Adless => runner.execute(*self, "adless", || adless::run_adless(ctx))?,
Copy link
Copy Markdown
Member

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.

AndroidStudio => runner.execute(*self, "Android Studio Plugins", || generic::run_android_studio(ctx))?,
AppMan =>
{
Expand Down Expand Up @@ -616,7 +617,6 @@ impl Step {
#[cfg(target_os = "linux")]
runner.execute(*self, "toolbx", || toolbx::run_toolbx(ctx))?
}
Typst => runner.execute(*self, "Typst", || generic::run_typst(ctx))?,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad rebase

Uv => runner.execute(*self, "uv", || generic::run_uv(ctx))?,
Vagrant => {
if ctx.config().should_run(Vagrant) {
Expand Down Expand Up @@ -761,6 +761,7 @@ pub(crate) fn default_steps() -> Vec<Step> {
Shell,
Tmux,
Pearl,
Adless,
#[cfg(not(any(target_os = "macos", target_os = "android")))]
GnomeShellExtensions,
Pyenv,
Expand Down Expand Up @@ -879,7 +880,6 @@ pub(crate) fn default_steps() -> Vec<Step> {
Powershell,
CustomCommands,
Vagrant,
Typst,
]);

steps.shrink_to_fit();
Expand Down
15 changes: 15 additions & 0 deletions src/steps/adless.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,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()
}
Comment on lines +1 to +15
Copy link
Copy Markdown
Member

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.

1 change: 1 addition & 0 deletions src/steps/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub mod adless;
pub mod containers;
pub mod emacs;
pub mod generic;
Expand Down
Loading