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

Function atomic_stdin

atomic-cli/tests/it/git_import_cb9b_test.rs:144–162  ·  view source on GitHub ↗
(root: &Path, home: &Path, args: &[&str], stdin: &[u8])

Source from the content-addressed store, hash-verified

142}
143
144fn atomic_stdin(root: &Path, home: &Path, args: &[&str], stdin: &[u8]) -> Output {
145 let mut child = Command::new(ATOMIC_BIN)
146 .args(args)
147 .current_dir(root)
148 .env("HOME", home)
149 .env("ATOMIC_HOME", home.join(".atomic"))
150 .stdin(Stdio::piped())
151 .stdout(Stdio::piped())
152 .stderr(Stdio::piped())
153 .spawn()
154 .expect("run atomic with stdin");
155 child
156 .stdin
157 .as_mut()
158 .unwrap()
159 .write_all(stdin)
160 .expect("write stdin");
161 child.wait_with_output().expect("wait for atomic")
162}
163
164fn decode_hex(hex: &str) -> Vec<u8> {
165 (0..hex.len())

Calls 2

spawnMethod · 0.80
unwrapMethod · 0.45

Tested by

no test coverage detected