Rewrite rust #38

Merged
kjuulh merged 24 commits from experiment/local into v0.3 2022-11-27 12:21:36 +01:00
7 changed files with 40 additions and 1 deletions
Showing only changes of commit b7a0e0b96e - Show all commits

View File

@ -47,9 +47,13 @@ pub async fn execute_subcommand(args: &ArgMatches) -> eyre::Result<()> {
repo_clones.push(tokio::spawn(async move { gp.clone_from_url(repo).await })); repo_clones.push(tokio::spawn(async move { gp.clone_from_url(repo).await }));
} }
let mut paths = Vec::new();
for repo_clone in repo_clones { for repo_clone in repo_clones {
let report = repo_clone.await??; let path = repo_clone.await??;
paths.push(path);
} }
kk
} }
} }

View File

@ -0,0 +1,18 @@
use async_trait::async_trait;
use crate::schema::models::Action;
use super::executor::Executor;
pub struct DefaultExecutor;
#[async_trait]
impl Executor for DefaultExecutor {
async fn execute(&self, action: Action) -> eyre::Result<()> {
match action {
Action::Go { entry } => todo!(),
}
Ok(())
}
}

View File

@ -0,0 +1,12 @@
use std::sync::Arc;
use async_trait::async_trait;
use crate::schema::models::Action;
#[async_trait]
pub trait Executor {
async fn execute(&self, action: Action) -> eyre::Result<()>;
}
pub type DynExecutor = Arc<dyn Executor + Send + Sync>;

View File

@ -0,0 +1 @@
pub mod golang;

View File

@ -0,0 +1,3 @@
pub mod default_executor;
pub mod executor;
mod executors;

View File

@ -1,3 +1,4 @@
pub mod git; pub mod git;
pub mod storage; pub mod storage;
pub mod schema; pub mod schema;
pub mod executor;