Function
walk
(cmd: ChildProcess.Command)
Source from the content-addressed store, hash-verified
| 55 | const opts: Array<ChildProcess.PipeOptions> = [] |
| 56 | |
| 57 | const walk = (cmd: ChildProcess.Command): void => { |
| 58 | switch (cmd._tag) { |
| 59 | case "StandardCommand": |
| 60 | commands.push(cmd) |
| 61 | return |
| 62 | case "PipedCommand": |
| 63 | walk(cmd.left) |
| 64 | opts.push(cmd.options) |
| 65 | walk(cmd.right) |
| 66 | return |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | walk(command) |
| 71 | if (commands.length === 0) throw new Error("flatten produced empty commands array") |
Tested by
no test coverage detected