From 26de0b878e8fb674fcad5c12a3cd81930ac4a81a Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Wed, 14 Feb 2024 12:41:09 -0500 Subject: [PATCH] Improve the unauthorized error output --- packages/db/src/core/cli/commands/link/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/db/src/core/cli/commands/link/index.ts b/packages/db/src/core/cli/commands/link/index.ts index e2b9008eac..f21715df8f 100644 --- a/packages/db/src/core/cli/commands/link/index.ts +++ b/packages/db/src/core/cli/commands/link/index.ts @@ -1,6 +1,6 @@ import type { AstroConfig } from 'astro'; import { mkdir, writeFile } from 'node:fs/promises'; -import { red } from 'kleur/colors'; +import { bgRed, cyan } from 'kleur/colors'; import prompts from 'prompts'; import type { Arguments } from 'yargs-parser'; import { PROJECT_ID_FILE, getSessionIdFromFile } from '../../../tokens.js'; @@ -31,7 +31,7 @@ export async function cmd({ flags }: { config: AstroConfig; flags: Arguments }) if (!response.ok) { // Unauthorized if(response.status === 401) { - console.error(`${red('Unauthorized')}.\n\nAre you logged in? Run \`astro db login\` to authenticate and then try linking again.`); + console.error(`${bgRed('Unauthorized')}\n\n Are you logged in?\n Run ${cyan('astro db login')} to authenticate and then try linking again.\n\n`); process.exit(1); }