Skip to content

Please make bun init --react not create in the current directory #24555

@peterbe

Description

@peterbe

What is the problem this feature would solve?

I too often type:

cd /tmp
bun init --react

or

cd ~/mycoolprojects
bun init --react

Now, I get a bunch of files in that directory.

What is the feature you are proposing to solve the problem?

It should ask "Are you sure you want create it here or in a new sub directory?"
And if you're in an empty directory it should omit the question.
E.g.

$ cd ~/mycoolprojects
$ bun init --react
Are you sure you want to create it in the current directory? [Y/n]

and

$ cd ~/mycoolprojects
$ mkdir new-project && cd new-project
$ bun init --react

What alternatives have you considered?

Consider what create-next-app does:

➜  /tmp $ bunx create-next-app@latest
? What is your project named? › my-app
...
cd my-app
ls

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