MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / runScript

Function runScript

apps/cloud/scripts/ensure-workos-mirror-ready.ts:75–86  ·  view source on GitHub ↗
(what: string, script: string)

Source from the content-addressed store, hash-verified

73// running them as subprocesses (with this process's env) keeps that wiring
74// in one place.
75const 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
88try {
89 await waitForDatabaseConnection(sql, { log });

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected