Skip to content
Open
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
11 changes: 7 additions & 4 deletions packages/dev/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,12 @@ ${
if (await configFile.exists()) {
userConfigData = await configFile.json();
} else {
console.warn("⚠️ config.json not found at runtime");
console.error("❌ config.json not found at runtime");
process.exit(1);
}
} catch (e) {
console.error("❌ Failed to load config.json:", e);
process.exit(1);
}
const client = new DjsClient<UserConfig>({ djsConfig: config, userConfig: userConfigData as UserConfig });`
: " const client = new DjsClient({ djsConfig: config });"
Expand Down Expand Up @@ -427,10 +429,11 @@ export function registerBuildCommand(cli: CAC) {
try {
await fs.copyFile(configJsonPath, outConfigJsonPath);
console.log(
pc.green("✓") + ` config.json copied to ${pc.bold("dist/")}`,
`${pc.green("✓")} config.json copied to ${pc.bold("dist/")}`,
);
} catch (e) {
console.warn(pc.yellow("⚠️ Could not copy config.json to dist/"));
} catch (_e) {
console.error(pc.red("❌ Could not copy config.json to dist/"));
process.exit(1);
}
}

Expand Down
7 changes: 3 additions & 4 deletions packages/dev/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,10 @@ export async function runBot(projectPath: string) {
userConfig = JSON.parse(configJsonContent);
console.log(`${pc.green("✓")} User config loaded`);
} catch (_error) {
console.warn(
pc.yellow(
"⚠️ userConfig is enabled but config.json not found or invalid",
),
console.error(
pc.red("❌ userConfig is enabled but config.json not found or invalid"),
);
process.exit(1);
}
}

Expand Down