MCPcopy Index your code
hub / github.com/arraypad/each / prepare

Method prepare

src/action.rs:48–59  ·  view source on GitHub ↗
(&self, value: &serde_json::Value)

Source from the content-addressed store, hash-verified

46 }
47
48 pub fn prepare(&self, value: &serde_json::Value) -> Result<Exec, Error> {
49 let mut cmd = Exec::cmd(&self.command);
50 for arg in &self.args {
51 cmd = cmd.arg(self.templates.render(arg, value)?);
52 }
53
54 if self.stdin {
55 cmd = cmd.stdin(self.templates.render("stdin", value)?.as_str());
56 }
57
58 Ok(cmd)
59 }
60
61 pub fn prompt(&self, cmd: &Exec, value: &serde_json::Value) -> Result<String, Error> {
62 let cmd_str = cmd.to_cmdline_lossy();

Callers 1

processFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected