idk
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { existsSync } from "node:fs";
|
||||
import { execSync } from "node:child_process";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { dirname } from "node:path";
|
||||
|
||||
const dir = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
if (!existsSync(`${dir}/node_modules`)) {
|
||||
console.log("node_modules not found, installing dependencies...");
|
||||
try {
|
||||
execSync("bun install --frozen-lockfile", { stdio: "inherit", cwd: dir, timeout: 120_000 });
|
||||
} catch {
|
||||
console.log("bun unavailable, falling back to npm...");
|
||||
execSync("npm install --no-fund --no-audit", { stdio: "inherit", cwd: dir, timeout: 120_000 });
|
||||
}
|
||||
}
|
||||
|
||||
await import("./entry.ts");
|
||||
Reference in New Issue
Block a user