(cmd: ChildProcess.Command)
| 695 | const pipeOptions: Array<ChildProcess.PipeOptions> = [] |
| 696 | |
| 697 | const flatten = (cmd: ChildProcess.Command): void => { |
| 698 | switch (cmd._tag) { |
| 699 | case "StandardCommand": { |
| 700 | commands.push(cmd) |
| 701 | break |
| 702 | } |
| 703 | case "PipedCommand": { |
| 704 | // Recursively flatten left side first |
| 705 | flatten(cmd.left) |
| 706 | // Store the pipe options for this connection |
| 707 | pipeOptions.push(cmd.options) |
| 708 | // Then flatten right side |
| 709 | flatten(cmd.right) |
| 710 | break |
| 711 | } |
| 712 | } |
| 713 | } |
| 714 | |
| 715 | flatten(command) |
| 716 |