Pi Executable

loom-builder-solsourcetypescript
Path: loom-builder-sol/src/pi-executable.tsRelative: src/pi-executable.tsSubproject: loom-builder-solCategory: dispatch-system-sol
Lines: 27Bytes: 861Imports: 1Exports: 3

Content Preview

  1. import { existsSync } from "node:fs";
  2. export interface PiExecutableCheck {
  3. ok: boolean;
  4. path: string;
  5. reason: string;
  6. }
  7. const WRONG_SYSTEM_PI = new Set(["/usr/bin/pi", "/bin/pi"]);
  8. export function validatePiExecutable(path: string | undefined): PiExecutableCheck {
  9. if (path === undefined || path === "") {
  10. return { ok: false, path: "", reason: "pi executable path is empty" };
  11. }
  12. if (WRONG_SYSTEM_PI.has(path)) {
  13. return { ok: false, path, reason: "resolved to the Linux math uti