Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds automatic, seasonally appropriate messages from Houston #9476

Merged
merged 18 commits into from
Jan 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: simplify seasonal data
  • Loading branch information
natemoo-re committed Jan 5, 2024
commit da9479834962cdfb01c93f274552e0f2d4efa329
8 changes: 4 additions & 4 deletions packages/create-astro/src/actions/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import arg from 'arg';
import os from 'node:os';

import { getName, getVersion } from '../messages.js';
import getSeasonalHouston from '../data/seasonal.js';
import getSeasonalData from '../data/seasonal.js';

export interface Context {
help: boolean;
Expand Down Expand Up @@ -86,7 +86,7 @@ export async function getContext(argv: string[]): Promise<Context> {
((os.platform() === 'win32' && !fancy) || skipHouston) ??
[yes, no, install, git, typescript].some((v) => v !== undefined);

const { messages, hats = [], ties = [] } = getSeasonalHouston({ fancy });
const { messages, hats, ties } = getSeasonalData({ fancy });

const context: Context = {
help,
Expand All @@ -101,8 +101,8 @@ export async function getContext(argv: string[]): Promise<Context> {
template,
ref: ref ?? 'latest',
welcome: random(messages),
hat: hats.length > 0 ? random(hats) : '',
tie: ties.length > 0 ? random(ties) : '',
hat: hats ? random(hats) : undefined,
tie: ties ? random(ties) : undefined,
yes,
install: install ?? (noInstall ? false : undefined),
git: git ?? (noGit ? false : undefined),
Expand Down
Loading