(what: string, script: string)
| 73 | // running them as subprocesses (with this process's env) keeps that wiring |
| 74 | // in one place. |
| 75 | const runScript = (what: string, script: string) => { |
| 76 | if (!process.env.WORKOS_API_KEY) { |
| 77 | throw new Error(`WORKOS_API_KEY is not set; the mirror ${what} cannot run`); |
| 78 | } |
| 79 | const result = spawnSync("bun", ["run", script], { |
| 80 | stdio: "inherit", |
| 81 | env: process.env, |
| 82 | }); |
| 83 | if (result.status !== 0) { |
| 84 | throw new Error(`the mirror ${what} exited with status ${result.status ?? "unknown"}`); |
| 85 | } |
| 86 | }; |
| 87 | |
| 88 | try { |
| 89 | await waitForDatabaseConnection(sql, { log }); |
no outgoing calls
no test coverage detected