Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions packages/cli/bin/epicenter.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env node

import { spawnSync } from "node:child_process";
import { fileURLToPath } from "node:url";

const isBun = typeof Bun !== "undefined";

if (!isBun) {
const bunCheck = spawnSync("bun", ["--version"], { stdio: "ignore" });

if (bunCheck.status === 0) {
const result = spawnSync(
"bun",
[fileURLToPath(import.meta.url), ...process.argv.slice(2)],
{ stdio: "inherit" },
);
process.exit(result.status ?? 1);
}

console.error(`Epicenter CLI requires Bun.

Install it:

curl -fsSL https://bun.sh/install | bash

Then run this command again. Learn more: https://bun.sh`);
process.exit(1);
}

await import("../src/bin.ts");
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"main": "./src/index.ts",
"types": "./src/index.ts",
"bin": {
"epicenter": "./src/bin.ts"
"epicenter": "./bin/epicenter.mjs"
},
"dependencies": {
"@epicenter/workspace": "workspace:*",
Expand Down
Loading