xianyun_executor/exec/
repository.rs1use crate::exec::ExecError;
6
7#[derive(Debug, Clone, Default)]
11pub struct Command {
12 pub name: String,
13 pub args: Vec<String>,
14 pub env: Option<Vec<String>>,
15 pub dir: Option<String>,
16}
17
18pub trait RepositoryExecutorDecorator {
20 fn wrap(&self, original: Command) -> Result<Command, ExecError>;
21}
22
23pub fn get_repository_decorators() -> Vec<Box<dyn RepositoryExecutorDecorator>> {
25 vec![Box::new(super::mise_decorator::MiseDecorator)]
26}
27
28#[cfg(test)]
29mod tests {
30 use super::*;
31
32 #[test]
33 fn get_repository_decorators_returns_decorators() {
34 let decorators = get_repository_decorators();
35 assert!(
36 !decorators.is_empty(),
37 "should return at least one decorator"
38 );
39 }
40}