import path from "node:path";
import { fileURLToPath } from "node:url";
import { installCppPack } from "./cpp-engine-pack.mjs";

const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const arguments_ = process.argv.slice(2);
if (arguments_.length > 1) {
  throw new Error(
    "Usage: node scripts/install-cpp-engine.mjs [.engine-build/cpp]",
  );
}
const source = path.resolve(root, arguments_[0] ?? ".engine-build/cpp");
const result = await installCppPack(source, root);
console.log(`Installed verified C++ engine pack at ${result.output}.`);
