mntn 4.0.3

A Rust-based command-line tool for dotfiles management with profiles.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::utils::display::green;
use eyre::{Result, WrapErr};

pub(crate) trait Command {
    fn name(&self) -> &str;
    fn execute(&mut self) -> Result<()>;
}

pub(crate) struct CommandExecutor;

impl CommandExecutor {
    pub(crate) fn run<T: Command>(task: &mut T) -> Result<()> {
        let name = task.name().to_string();
        task.execute().wrap_err_with(|| format!("{name} failed"))?;
        println!("{}", green(&format!("{} complete", name)));
        Ok(())
    }
}