0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-17 23:11:29 -05:00

Add some color to the unauthorized message

This commit is contained in:
Matthew Phillips 2024-02-13 17:07:45 -05:00
parent 43a82bb04e
commit 54b82ca416

View file

@ -1,5 +1,6 @@
import type { AstroConfig } from 'astro';
import { mkdir, writeFile } from 'node:fs/promises';
import { red } from 'kleur/colors';
import prompts from 'prompts';
import type { Arguments } from 'yargs-parser';
import { PROJECT_ID_FILE, getSessionIdFromFile } from '../../../tokens.js';
@ -30,7 +31,7 @@ export async function cmd({ flags }: { config: AstroConfig; flags: Arguments })
if (!response.ok) {
// Unauthorized
if(response.status === 401) {
console.error('Unauthorized. Are you logged in? Run `astro db login` to authenticate and then try linking again.');
console.error(`${red('Unauthorized')}.\n\nAre you logged in? Run \`astro db login\` to authenticate and then try linking again.`);
process.exit(1);
}