Skip to content
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
hoist printing the CLI header
This allows us to:

1. Only output the header once
2. Output a log from Oxide that will end up underneath the header
  • Loading branch information
RobinMalfait committed May 7, 2025
commit 07f2854be846b9cb5570616bd8438e1e494c4431
9 changes: 3 additions & 6 deletions packages/@tailwindcss-cli/src/commands/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ async function handleError<T>(fn: () => T): Promise<T> {
}

export async function handle(args: Result<ReturnType<typeof options>>) {
eprintln(header())
eprintln()

using I = new Instrumentation()
DEBUG && I.start('[@tailwindcss/cli] (initial build)')

Expand All @@ -87,8 +90,6 @@ export async function handle(args: Result<ReturnType<typeof options>>) {

// Ensure the provided `--input` exists.
if (!existsSync(args['--input'])) {
eprintln(header())
eprintln()
eprintln(`Specified input file ${highlight(relative(args['--input']))} does not exist.`)
process.exit(1)
}
Expand All @@ -97,8 +98,6 @@ export async function handle(args: Result<ReturnType<typeof options>>) {
// Check if the input and output file paths are identical, otherwise return an
// error to the user.
if (args['--input'] === args['--output'] && args['--input'] !== '-') {
eprintln(header())
eprintln()
eprintln(
`Specified input file ${highlight(relative(args['--input']))} and output file ${highlight(relative(args['--output']))} are identical.`,
)
Expand Down Expand Up @@ -328,8 +327,6 @@ export async function handle(args: Result<ReturnType<typeof options>>) {
await write(output, args, I)

let end = process.hrtime.bigint()
eprintln(header())
eprintln()
eprintln(`Done in ${formatDuration(end - start)}`)
}

Expand Down