-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: add ability to scaffold in non-empty directories #230
Comments
I think what you are describing is a bit of an edgecase, and only warn when certain directories exists would be complicated. What I could see here is modifying the existing prompt to allow for something like:
What do you think? |
That’s a great solution |
I don’t know how much work this would be, but listing the conflicting files would be useful. |
Feel free to PR this. I dont have much time for coding currently. |
It only aborts if you are creating a new directory with the same name, right?
Wouldn't this solution cause this warning to happen the majority of the time you are using the cli (e.g. in a folder with other projects)? |
It shouldn't. This prompt only shows up if it detects that the directory you have entered to scaffold in isn't empty. This behavior should not change. What's proposed is to have more options when this occurs. Currently we only have cancel or empty directory, the proposal is to have an option to continue without emptying and just overwriting the conflicting files and let the rest remain. |
For anyone wanting to pick this up, I think we should satisfy with my suggestion above and just let the fs calls overwrite. Explicitly saying what files conflict seems scary and bad if we get it "wrong" (indicated by the amount of edge cases I could think this seems quite likely). |
Describe the bug
I can't initialize create-t3-app inside of a git worktree folder because it already contains a .git file.
To Reproduce
create a repo on github
It will abort because the directory is not empty.
Expected behavior
The script should continue because the .git file does not interfere with other files.
The text was updated successfully, but these errors were encountered: