open-design/tools/pack/bin/tools-pack.mjs

17 lines
510 B
JavaScript
Raw Permalink Normal View History

#!/usr/bin/env node
import { existsSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
const entryDir = dirname(fileURLToPath(import.meta.url));
const distEntry = resolve(entryDir, "../dist/index.mjs");
if (!existsSync(distEntry)) {
throw new Error(
`tools-pack dist entry not found at ${distEntry}. Run "pnpm --filter @open-design/tools-pack build" first.`,
);
}
await import(pathToFileURL(distEntry).href);