Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

387 B
Raw Blame
import { spawnSync } from "node:child_process";

export function exec(file, args = [], opts = {}) {
  const r = spawnSync(file, args, { encoding: "utf8", ...opts });
  return {
    status: r.status ?? (r.error ? 1 : 0),
    stdout: r.stdout ?? "",
    stderr: r.stderr ?? "",
    error: r.error,
  };
}

export function bash(cmd, opts = {}) {
  return exec("bash", ["-c", cmd], opts);
}