#!/usr/bin/env bun
import { spawn } from "child_process";
import { fileURLToPath } from "url";
import { dirname, join } from "path";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const mainPath = join(__dirname, "../main.tsx");

const proc = spawn("bun", ["run", mainPath, ...process.argv.slice(2)], {
  stdio: "inherit",
});

proc.on("exit", (code) => {
  process.exit(code ?? 0);
});
