| 229 | } |
| 230 | |
| 231 | fn shell_command(command: &str) -> CommandWithStdin { |
| 232 | #[cfg(windows)] |
| 233 | let mut command_builder = { |
| 234 | let mut command_builder = Command::new("cmd"); |
| 235 | command_builder.arg("/C").arg(command); |
| 236 | CommandWithStdin::new(command_builder) |
| 237 | }; |
| 238 | |
| 239 | #[cfg(not(windows))] |
| 240 | let command_builder = { |
| 241 | let mut command_builder = Command::new("sh"); |
| 242 | command_builder.arg("-lc").arg(command); |
| 243 | CommandWithStdin::new(command_builder) |
| 244 | }; |
| 245 | |
| 246 | command_builder |
| 247 | } |
| 248 | |
| 249 | struct CommandWithStdin { |
| 250 | command: Command, |