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:
parent
43a82bb04e
commit
54b82ca416
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue