(&self, args: &[&str], input: Option<&[u8]>)
| 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); |
no test coverage detected