Skip to content

Commit b23ef04

Browse files
committed
Cleaning up clark
1 parent 6416fb5 commit b23ef04

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/cli.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Command, InvalidArgumentError } from 'commander'
2-
import { log } from '@clack/prompts'
2+
import { intro, log } from '@clack/prompts'
33

44
import { createApp } from './create-app.js'
55
import { normalizeOptions, promptForOptions } from './options.js'
@@ -55,7 +55,10 @@ export function cli() {
5555
...options,
5656
} as CliOptions
5757
let finalOptions = normalizeOptions(cliOptions)
58-
if (!finalOptions) {
58+
if (finalOptions) {
59+
intro(`Creating a new TanStack app in ${projectName}...`)
60+
} else {
61+
intro("Let's configure your TanStack application")
5962
finalOptions = await promptForOptions(cliOptions)
6063
}
6164
await createApp(finalOptions)

src/create-app.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import {
88
writeFile,
99
} from 'node:fs/promises'
1010
import { existsSync, readdirSync, statSync } from 'node:fs'
11-
import { dirname, resolve } from 'node:path'
11+
import { basename, dirname, resolve } from 'node:path'
1212
import { fileURLToPath } from 'node:url'
13-
import { intro, log, outro, spinner } from '@clack/prompts'
13+
import { log, outro, spinner } from '@clack/prompts'
1414
import { execa } from 'execa'
1515
import { render } from 'ejs'
1616
import { format } from 'prettier'
@@ -241,7 +241,7 @@ export async function createApp(options: Required<Options>) {
241241
const isAddOnEnabled = (id: string) =>
242242
options.chosenAddOns.find((a) => a.id === id)
243243

244-
intro(`Creating a new TanStack app in ${targetDir}...`)
244+
log.info(`Creating a new TanStack app in '${basename(targetDir)}'...`)
245245

246246
// Make the root directory
247247
await mkdir(targetDir, { recursive: true })
@@ -434,7 +434,7 @@ export async function createApp(options: Required<Options>) {
434434
s.stop(`Initialized git repository`)
435435
}
436436

437-
outro(`Created your new TanStack app in ${targetDir}.
437+
outro(`Created your new TanStack app in '${basename(targetDir)}'.
438438
439439
Use the following commands to start your app:
440440
% cd ${options.projectName}

0 commit comments

Comments
 (0)