chore: Added error handling for figlet banner 312aae17
Steve · 2025-05-16 12:23 1 file(s) · +17 −9
src/index.ts +17 −9
50 50
}
51 51
52 52
function displayBanner() {
53 -
	const text = figlet.textSync("bhvr", {
54 -
		font: "Big",
55 -
		horizontalLayout: "default",
56 -
		verticalLayout: "default",
57 -
		width: 80,
58 -
		whitespaceBreak: true,
59 -
	});
53 +
	try {
54 +
		const text = figlet.textSync("bhvr", {
55 +
			font: "Standard", // Use the Standard font which is more commonly available
56 +
			horizontalLayout: "default",
57 +
			verticalLayout: "default",
58 +
			width: 80,
59 +
			whitespaceBreak: true,
60 +
		});
60 61
61 -
	console.log("\n");
62 -
	console.log(chalk.yellowBright(text));
62 +
		console.log("\n");
63 +
		console.log(chalk.yellowBright(text));
64 +
	} catch (error) {
65 +
		// Fallback in case figlet fails for any reason
66 +
		console.log("\n");
67 +
		console.log(chalk.yellowBright("B H V R"));
68 +
		console.log(chalk.yellow("=========="));
69 +
	}
70 +
63 71
	console.log(`\n${chalk.cyan("🦫 Lets build 🦫")}\n`);
64 72
	console.log(`${chalk.blue("https://github.com/stevedylandev/bhvr")}\n`);
65 73
}