Files
better-auth/packages/cli/test/utils.ts
2025-11-06 00:01:41 +00:00

15 lines
413 B
TypeScript

import fs from "node:fs/promises";
import path from "node:path";
import type { PackageJson } from "type-fest";
const rootDir = path.resolve(import.meta.dirname, "..");
const getCliPath = async () => {
const pkgJson: PackageJson = JSON.parse(
await fs.readFile(path.join(rootDir, "package.json"), "utf-8"),
);
return path.join(rootDir, pkgJson.bin as string);
};
export const cliPath = await getCliPath();