( input: SetupInput | undefined, )
| 10 | export type SetupInput = Array<string> | ((builder: SetupBuilder) => void) |
| 11 | |
| 12 | export function buildSetupPlan( |
| 13 | input: SetupInput | undefined, |
| 14 | ): Array<SetupGroup> { |
| 15 | if (input === undefined) return [] |
| 16 | if (Array.isArray(input)) { |
| 17 | return input.map((command) => ({ kind: 'serial', command })) |
| 18 | } |
| 19 | const groups: Array<SetupGroup> = [] |
| 20 | input({ |
| 21 | serial: (command) => groups.push({ kind: 'serial', command }), |
| 22 | parallel: (commands) => groups.push({ kind: 'parallel', commands }), |
| 23 | }) |
| 24 | return groups |
| 25 | } |
no test coverage detected