#!/usr/bin/env node
// Entry point for `npx appostle-installer`.

// Defensive Node version check.
// We rely on `node:util#styleText` (added in Node 20.12) via @clack/core.
// `engines` in package.json only warns on most installs; this is the hard gate.
const [major, minor] = process.versions.node.split(".").map(Number);
if (major < 20 || (major === 20 && minor < 12)) {
  console.error(
    `\n  appostle-installer requires Node.js >= 20.12.0` +
      `\n  Detected: ${process.versions.node}` +
      `\n` +
      `\n  Upgrade via your OS package manager, or install Node 22 LTS:` +
      `\n    macOS:   brew install node@22` +
      `\n    Linux:   curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - && sudo apt install -y nodejs` +
      `\n    Windows: https://nodejs.org/en/download` +
      `\n`,
  );
  process.exit(1);
}

import("../dist/appostle-installer.js");
