Files
HiveGrid-Wireframes/03 Quellen und Referenzen/hivegrid-cloud/packages/cli/bin/hivegrid-cli.mjs
T
2026-07-08 16:15:37 +02:00

18 lines
721 B
JavaScript
Executable File

#!/usr/bin/env node
// Thin shim so the CLI is callable as `hivegrid-cli`.
// The actual command tree lives in ../src/index.ts and is loaded via tsx in dev,
// or via the compiled output once the build pipeline produces dist/index.js.
import { fileURLToPath, pathToFileURL } from "node:url";
import { existsSync } from "node:fs";
import { dirname, resolve } from "node:path";
const __dirname = dirname(fileURLToPath(import.meta.url));
const distEntry = resolve(__dirname, "../dist/index.js");
const srcEntry = resolve(__dirname, "../src/index.ts");
const target = existsSync(distEntry) ? distEntry : srcEntry;
const moduleUrl = pathToFileURL(target).href;
const { runMain } = await import(moduleUrl);
await runMain();