feat(create-astro): --fancy (#8235)
This commit is contained in:
parent
23096dbee8
commit
2bdce4c4a0
2 changed files with 5 additions and 2 deletions
|
@ -13,6 +13,7 @@ export interface Context {
|
|||
username: string;
|
||||
version: string;
|
||||
skipHouston: boolean;
|
||||
fancy?: boolean;
|
||||
dryRun?: boolean;
|
||||
yes?: boolean;
|
||||
projectName?: string;
|
||||
|
@ -88,6 +89,7 @@ export async function getContext(argv: string[]): Promise<Context> {
|
|||
username,
|
||||
version,
|
||||
skipHouston,
|
||||
fancy,
|
||||
dryRun,
|
||||
projectName,
|
||||
template,
|
||||
|
|
|
@ -4,8 +4,9 @@ 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'>) {
|
||||
export async function intro(ctx: Pick<Context, 'skipHouston' | 'version' | 'username' | 'fancy'>) {
|
||||
if (!ctx.skipHouston) {
|
||||
const hat = ctx.fancy ? random(['🎩', '🎩', '👑', '🧢', '🍦']) : undefined;
|
||||
await say([
|
||||
[
|
||||
'Welcome',
|
||||
|
@ -15,7 +16,7 @@ export async function intro(ctx: Pick<Context, 'skipHouston' | 'version' | 'user
|
|||
`${ctx.username}!`,
|
||||
],
|
||||
random(welcome),
|
||||
]);
|
||||
], { hat });
|
||||
await banner(ctx.version);
|
||||
} else {
|
||||
await banner(ctx.version);
|
||||
|
|
Loading…
Reference in a new issue