mirror of
https://github.com/openclaw/clawhub.git
synced 2026-08-14 00:47:57 +00:00
20 lines
699 B
JavaScript
20 lines
699 B
JavaScript
import { spawnSync } from "node:child_process";
|
|
import { rm } from "node:fs/promises";
|
|
import { createRequire } from "node:module";
|
|
import { dirname, resolve } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const require = createRequire(import.meta.url);
|
|
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
const distDir = resolve(packageRoot, "dist");
|
|
|
|
await rm(distDir, { recursive: true, force: true });
|
|
|
|
const tscBin = resolve(dirname(require.resolve("@typescript/native/package.json")), "bin/tsc");
|
|
const result = spawnSync(process.execPath, [tscBin, "-p", "tsconfig.json"], {
|
|
cwd: packageRoot,
|
|
stdio: "inherit",
|
|
});
|
|
|
|
process.exit(result.status ?? 1);
|