trello-to-deck/src/execute.rs

22 lines
619 B
Rust
Raw Normal View History

//
use color_eyre::eyre::eyre;
use color_eyre::Result;
use crate::FullCtx;
pub(crate) trait Execute {
async fn execute(&self, ctx: &FullCtx) -> Result<()>;
}
impl Execute for crate::Command {
async fn execute(&self, ctx: &FullCtx) -> Result<()> {
match self {
Self::Init => Err(eyre!("Config file already exists. Not overwriting it.")),
Self::Check => crate::check::run(ctx).await,
2024-12-19 09:04:23 +00:00
Self::Import => crate::import::run(ctx).await,
Self::Trello(cmd) => cmd.execute(ctx).await,
Self::Nextcloud(cmd) => cmd.execute(ctx).await,
}
}
}