MCPcopy Create free account
hub / github.com/anomalyco/opencode / walk

Function walk

packages/core/src/cross-spawn-spawner.ts:57–68  ·  view source on GitHub ↗
(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")

Callers 1

flattenFunction · 0.70

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected