| 81 | |
| 82 | /** Paginated GET that concatenates every page of `result`. */ |
| 83 | const cfList = async (path: string): Promise<any[]> => { |
| 84 | const all: any[] = []; |
| 85 | const separator = path.includes("?") ? "&" : "?"; |
| 86 | for (let page = 1; ; page++) { |
| 87 | const items = await cfOk("GET", `${path}${separator}page=${page}&per_page=100`); |
| 88 | all.push(...items); |
| 89 | if (items.length < 100) return all; |
| 90 | } |
| 91 | }; |
| 92 | |
| 93 | const run = (command: string, args: string[], options?: { input?: string; cwd?: string }): void => { |
| 94 | const result = spawnSync(command, args, { |