0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00

[ci] format

This commit is contained in:
natemoo-re 2023-09-13 14:43:40 +00:00 committed by astrobot-houston
parent ed952b4cea
commit 3be8b67f89
2 changed files with 8 additions and 4 deletions

View file

@ -4,7 +4,9 @@ import { color, label } from '@astrojs/cli-kit';
import { random } from '@astrojs/cli-kit/utils'; import { random } from '@astrojs/cli-kit/utils';
import { banner, say, welcome } from '../messages.js'; import { banner, say, welcome } from '../messages.js';
export async function intro(ctx: Pick<Context, 'hat' | 'skipHouston' | 'version' | 'username' | 'fancy'>) { export async function intro(
ctx: Pick<Context, 'hat' | 'skipHouston' | 'version' | 'username' | 'fancy'>
) {
banner(); banner();
if (!ctx.skipHouston) { if (!ctx.skipHouston) {
@ -14,8 +16,10 @@ export async function intro(ctx: Pick<Context, 'hat' | 'skipHouston' | 'version'
'Welcome', 'Welcome',
'to', 'to',
label('astro', color.bgGreen, color.black), label('astro', color.bgGreen, color.black),
Promise.resolve(ctx.version).then(version => ((version ? color.green(`v${version}`) : '') + ',')), Promise.resolve(ctx.version).then(
Promise.resolve(ctx.username).then(username => `${username}!`), (version) => (version ? color.green(`v${version}`) : '') + ','
),
Promise.resolve(ctx.username).then((username) => `${username}!`),
], ],
random(welcome), random(welcome),
], ],

View file

@ -92,7 +92,7 @@ export const banner = () => {
const prefix = `astro`; const prefix = `astro`;
const suffix = `Launch sequence initiated.`; const suffix = `Launch sequence initiated.`;
log(`${label(prefix, color.bgGreen, color.black)} ${suffix}`); log(`${label(prefix, color.bgGreen, color.black)} ${suffix}`);
} };
export const bannerAbort = () => export const bannerAbort = () =>
log(`\n${label('astro', color.bgRed)} ${color.bold('Launch sequence aborted.')}`); log(`\n${label('astro', color.bgRed)} ${color.bold('Launch sequence aborted.')}`);