fix(ui): initialize colors early for consistent status output

Call initUI() at the start of main() to ensure chalk is loaded
before any status messages. Previously, colors only worked when
an update notification was displayed because showUpdateNotification()
was the only place calling initUI().

Fixes #201
This commit is contained in:
kaitranntt
2025-12-25 04:53:32 -05:00
parent 2c977f686a
commit e38af6ad6e
+7
View File
@@ -255,6 +255,13 @@ async function main(): Promise<void> {
const args = process.argv.slice(2);
const firstArg = args[0];
// Initialize UI colors early to ensure consistent colored output
// Must happen before any status messages (ok, info, fail, etc.)
if (process.stdout.isTTY && !process.env['CI']) {
const { initUI } = await import('./utils/ui');
await initUI();
}
// Trigger update check early for ALL commands except version/help/update
// Only if TTY and not CI to avoid noise in automated environments
const skipUpdateCheck = [