Execute a command and return the rendered template
(&self, name: &str, ctx: CommandContext)
| 171 | |
| 172 | /// Execute a command and return the rendered template |
| 173 | pub fn execute(&self, name: &str, ctx: CommandContext) -> anyhow::Result<String> { |
| 174 | let command = self |
| 175 | .commands |
| 176 | .get(name) |
| 177 | .ok_or_else(|| anyhow::anyhow!("Command not found: {}", name))?; |
| 178 | |
| 179 | Ok(self.render_template(&command.template, ctx)) |
| 180 | } |
| 181 | |
| 182 | /// Execute a command with plugin hooks (async version) |
| 183 | pub async fn execute_with_hooks( |
no test coverage detected