Diffinery

codician/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

22 lines · 734 BRaw History
1import { main } from "./main.js";
2
3// The bundle targets Node.js 22; on an older one, say so instead of failing somewhere obscure.
4if (Number(process.versions.node.split(".")[0]) < 22) {
5 process.stderr.write(`error: diffinery needs Node.js 22 or later (this is ${process.version}). Reinstall with: curl -fsSL https://diffinery.com/install | bash\n`);
6 process.exit(1);
7}
8
9// EPIPE when piping into `head` and similar should end quietly.
10process.stdout.on("error", (e: NodeJS.ErrnoException) => {
11 if (e.code === "EPIPE") process.exit(0);
12});
13
14main(process.argv.slice(2)).then(
15 (code) => {
16 process.exitCode = code;
17 },
18 (e: unknown) => {
19 process.stderr.write(`error: ${String(e)}\n`);
20 process.exitCode = 1;
21 },
22);