mirror of
https://github.com/different-ai/openwork
synced 2026-04-26 01:25:10 +02:00
29 lines
511 B
TypeScript
29 lines
511 B
TypeScript
import { run } from "./client";
|
|
|
|
const REQUIRED = [
|
|
"pnpm",
|
|
"cargo",
|
|
"gh",
|
|
"hdiutil",
|
|
"codesign",
|
|
"spctl",
|
|
];
|
|
|
|
export async function loadEnv() {
|
|
const missing: string[] = [];
|
|
|
|
for (const bin of REQUIRED) {
|
|
try {
|
|
await run("/usr/bin/env", ["bash", "-lc", `command -v ${bin}`], { allowFailure: false });
|
|
} catch {
|
|
missing.push(bin);
|
|
}
|
|
}
|
|
|
|
if (missing.length) {
|
|
throw new Error(`Missing required tools: ${missing.join(", ")}`);
|
|
}
|
|
|
|
return { ok: true as const };
|
|
}
|