[READ-ONLY] Mirror of https://github.com/bombshell-dev/tools. Internal CLI to standardize tooling across all Bombshell projects
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334import { cwd } from "node:process";import { fileURLToPath, pathToFileURL } from "node:url";import escalade from "escalade";
export function local(file: string) { return fileURLToPath( new URL(`../node_modules/.bin/${file}`, import.meta.url), );}
export async function getPackageJSONPath(): Promise<string> { const pkgPath = await escalade(cwd(), (dir, files) => { return files.find((file) => file === "package.json"); }); if (!pkgPath) { throw new Error("No package.json found"); } return pkgPath;}
export async function getPackageJSON() { const pkg = await escalade(cwd(), (dir, files) => { return files.find((file) => file === "package.json"); }); if (!pkg) { throw new Error("No package.json found"); } const pkgPath = pathToFileURL(pkg); const { default: json } = await import(pkgPath.toString(), { with: { type: "json" }, }); return json;}