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

Method atomic_with_stdin

atomic-cli/tests/it/git_guard_cb0c_test.rs:70–96  ·  view source on GitHub ↗
(&self, args: &[&str], input: Option<&[u8]>)

Source from the content-addressed store, hash-verified

68 }
69
70 fn atomic_with_stdin(&self, args: &[&str], input: Option<&[u8]>) -> Output {
71 let mut command = Command::new(ATOMIC_BIN);
72 command
73 .args(args)
74 .current_dir(self.root())
75 .env("HOME", self.home.path())
76 .env("ATOMIC_HOME", self.home.path().join(".atomic"))
77 .env("ATOMIC_NONINTERACTIVE", "1")
78 .env("NO_COLOR", "1")
79 .env("CLICOLOR", "0")
80 .env("TERM", "dumb")
81 .stdout(Stdio::piped())
82 .stderr(Stdio::piped());
83 if input.is_some() {
84 command.stdin(Stdio::piped());
85 }
86 let mut child = command.spawn().expect("spawn atomic");
87 if let Some(input) = input {
88 child
89 .stdin
90 .take()
91 .expect("atomic stdin")
92 .write_all(input)
93 .expect("write atomic stdin");
94 }
95 child.wait_with_output().expect("wait for atomic")
96 }
97
98 fn atomic_ok(&self, args: &[&str]) -> Output {
99 let output = self.atomic(args);

Callers 2

atomicMethod · 0.45
atomic_with_inputMethod · 0.45

Calls 3

spawnMethod · 0.80
rootMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected