| 237 | } |
| 238 | |
| 239 | fn shell_command(command: &str) -> CommandWithStdin { |
| 240 | #[cfg(windows)] |
| 241 | let mut command_builder = { |
| 242 | let mut command_builder = Command::new("cmd"); |
| 243 | command_builder.arg("/C").arg(command); |
| 244 | CommandWithStdin::new(command_builder) |
| 245 | }; |
| 246 | |
| 247 | #[cfg(not(windows))] |
| 248 | let command_builder = { |
| 249 | let mut command_builder = Command::new("sh"); |
| 250 | command_builder.arg("-lc").arg(command); |
| 251 | CommandWithStdin::new(command_builder) |
| 252 | }; |
| 253 | |
| 254 | command_builder |
| 255 | } |
| 256 | |
| 257 | struct CommandWithStdin { |
| 258 | command: Command, |