From 7cbcf443baca6279bcd12b20ddd972e70a4dea11 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Sat, 3 Aug 2024 16:05:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20don't=20show=20unhandled?= =?UTF-8?q?=20error=20twice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 49cb953..c6a07ea 100644 --- a/src/main.ts +++ b/src/main.ts @@ -31,13 +31,11 @@ export async function runMain( } } catch (error: any) { const isCLIError = error instanceof CLIError; - if (!isCLIError) { - consola.error(error, "\n"); - } if (isCLIError) { await showUsage(...(await resolveSubCommand(cmd, rawArgs))); + } else { + consola.error(error, "\n"); } - consola.error(error.message); process.exit(1); } }