2026-04-10 20:33:18 -05:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
2026-05-05 14:31:16 +02:00
|
|
|
import { spawnSync } from "node:child_process";
|
2026-04-10 20:33:18 -05:00
|
|
|
|
2026-05-05 14:31:16 +02:00
|
|
|
if (process.env.CI === "true" || process.env.CI === "1") {
|
|
|
|
|
process.exit(0);
|
2026-04-10 20:33:18 -05:00
|
|
|
}
|
|
|
|
|
|
2026-05-05 14:31:16 +02:00
|
|
|
const result = spawnSync("git", ["diff", "--exit-code"], {
|
|
|
|
|
stdio: "inherit",
|
|
|
|
|
shell: process.platform === "win32",
|
2026-04-10 20:33:18 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (result.status === 0) {
|
2026-05-05 14:31:16 +02:00
|
|
|
process.exit(0);
|
2026-04-10 20:33:18 -05:00
|
|
|
}
|
|
|
|
|
|
2026-05-05 14:31:16 +02:00
|
|
|
process.stderr.write(
|
|
|
|
|
"ERROR: version sync changed files — commit them before publishing\n",
|
|
|
|
|
);
|
2026-04-10 20:33:18 -05:00
|
|
|
process.exit(result.status ?? 1);
|