0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/packages/create-astro/src/actions/intro.ts
2023-02-06 16:21:48 +00:00

23 lines
575 B
TypeScript

import { type Context } from './context';
import { color, label } from '@astrojs/cli-kit';
import { random } from '@astrojs/cli-kit/utils';
import { banner, say, welcome } from '../messages.js';
export async function intro(ctx: Pick<Context, 'skipHouston' | 'version' | 'username'>) {
if (!ctx.skipHouston) {
await say([
[
'Welcome',
'to',
label('astro', color.bgGreen, color.black),
color.green(`v${ctx.version}`) + ',',
`${ctx.username}!`,
],
random(welcome),
]);
await banner(ctx.version);
} else {
await banner(ctx.version);
}
}