Skip to content

[Feature] Warn when target directory already exists and is not empty ✅ #198

@Kamleshpaul

Description

@Kamleshpaul

Which project does this relate to?

Create Tanstack App

Describe the feature

Currently, when running

pnpm create @tanstack/start@latest

and specifying a directory name that already exists (for example, an existing Next.js project folder), the setup proceeds and installs TanStack Start inside that directory — even if it is not empty.

It would be helpful to have a check to detect if the target directory already exists and is not empty, and show a warning or confirmation prompt before continuing. This would help prevent accidental overwriting of existing files or projects.

Example

$ pnpm create @tanstack/start@latest test
⚠️ The directory "test" already exists and is not empty. 
Do you want to continue? (y/N)

Why This Is Needed

This feature would improve safety and developer experience by preventing users from unintentionally installing TanStack Start into non-empty folders.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions