mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-23 23:52:05 -05:00
chore: output resolved path in CLI when config couldn't be read (#518)
This commit is contained in:
@@ -99,6 +99,7 @@ export async function getConfig({
|
||||
try {
|
||||
let configFile: BetterAuthOptions | null = null;
|
||||
if (configPath) {
|
||||
const resolvedPath = path.join(cwd, configPath);
|
||||
const { config } = await loadConfig<{
|
||||
auth: {
|
||||
options: BetterAuthOptions;
|
||||
@@ -107,13 +108,13 @@ export async function getConfig({
|
||||
options: BetterAuthOptions;
|
||||
};
|
||||
}>({
|
||||
configFile: path.join(cwd, configPath),
|
||||
configFile: resolvedPath,
|
||||
dotenv: true,
|
||||
jitiOptions: jitiOptions(cwd),
|
||||
});
|
||||
if (!config.auth && !config.default) {
|
||||
logger.error(
|
||||
"[#better-auth]: Couldn't read your auth config. Make sure to default export your auth instance or to export as a variable named auth.",
|
||||
`[#better-auth]: Couldn't read your auth config in ${resolvedPath}. Make sure to default export your auth instance or to export as a variable named auth.`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user