Rewrite rust #38
@ -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 }));
|
||||
}
|
||||
|
||||
let mut paths = Vec::new();
|
||||
for repo_clone in repo_clones {
|
||||
let report = repo_clone.await??;
|
||||
let path = repo_clone.await??;
|
||||
paths.push(path);
|
||||
}
|
||||
|
||||
kk
|
||||
}
|
||||
}
|
||||
|
||||
|
18
crates/octopush_core/src/executor/default_executor.rs
Normal file
18
crates/octopush_core/src/executor/default_executor.rs
Normal 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(())
|
||||
}
|
||||
}
|
12
crates/octopush_core/src/executor/executor.rs
Normal file
12
crates/octopush_core/src/executor/executor.rs
Normal 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>;
|
1
crates/octopush_core/src/executor/executors/mod.rs
Normal file
1
crates/octopush_core/src/executor/executors/mod.rs
Normal file
@ -0,0 +1 @@
|
||||
pub mod golang;
|
3
crates/octopush_core/src/executor/mod.rs
Normal file
3
crates/octopush_core/src/executor/mod.rs
Normal file
@ -0,0 +1,3 @@
|
||||
pub mod default_executor;
|
||||
pub mod executor;
|
||||
mod executors;
|
@ -1,3 +1,4 @@
|
||||
pub mod git;
|
||||
pub mod storage;
|
||||
pub mod schema;
|
||||
pub mod executor;
|
||||
|
Loading…
Reference in New Issue
Block a user