MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / resolve_body

Method resolve_body

atomic-cli/src/commands/intent/update.rs:132–145  ·  view source on GitHub ↗

Resolve the body override: inline `--body` or `--body-stdin`. Shared by the local body and the service-layer hook — reading the client's stdin is client-side by design, so the routed path resolves the body with this SAME code and sends it on the wire.

(&self)

Source from the content-addressed store, hash-verified

130 /// client's stdin is client-side by design, so the routed path resolves
131 /// the body with this SAME code and sends it on the wire.
132 pub(crate) fn resolve_body(&self) -> CliResult<Option<String>> {
133 if let Some(ref body) = self.body {
134 return Ok(Some(body.clone()));
135 }
136 if self.body_stdin {
137 use std::io::Read;
138 let mut content = String::new();
139 std::io::stdin()
140 .read_to_string(&mut content)
141 .map_err(CliError::Io)?;
142 return Ok(Some(content));
143 }
144 Ok(None)
145 }
146}
147
148impl Command for IntentUpdate {

Callers 2

intent_updateFunction · 0.80
runMethod · 0.80

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected