Skip to content
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

Allow creating project in a nonempty directory. #39220

Closed
wants to merge 1 commit into from

Conversation

rcorre
Copy link
Contributor

@rcorre rcorre commented Jun 1, 2020

Currently we disallow creating a project in a directory that has any
unhidden files. This is unnecessarily restrictive, as there are only 3
files we create that could conflict. We should only disallow creation if
the directory contains one of those 3 files.

A common flow for me is to start creating models in Blender before
creating a Godot project.

Currently we disallow creating a project in a directory that has any
unhidden files. This is unnecessarily restrictive, as there are only 3
files we create that could conflict. We should only disallow creation if
the directory contains one of those 3 files.

A common flow for me is to start creating models in Blender before
creating a Godot project.
@rcorre
Copy link
Contributor Author

rcorre commented Jun 1, 2020

Let me know if I should create an improvement proposal for this. It was a small annoyance, and it was just as easy to submit a PR as write up a proposal.

Relates a bit to #25925.

@groud
Copy link
Member

groud commented Jun 1, 2020

UX-wise this is worse. You should not be able to create a project in a non-empty directory unless you are absolutely sure to do so. Otherwise, if a user makes a mistake it will be very difficult to clean it up (even if it's only a matter of deleting a few files, the user should not have to know which files were created).

The right solution would be to display a big warning when you try to setup a project in a non-empty directory, and ask for confirmation before creating the project.

Until then, I believe it's better to forbid the creation of projects in non-empty folders.

@realkotob
Copy link
Contributor

realkotob commented Jun 1, 2020

Alternatively, we can always automatically create a new folder inside the chosen folder, this is what Unity does and it works fine.

In the rare case I want to use an existing folder for a unity project, I just copy paste the generated stuff into the parent directory.

If we always recommend that users create a new folder, why is it even a separate step?

@bruvzg
Copy link
Member

bruvzg commented Jun 1, 2020

Original issue (#15775) do not exist anymore for some reason, but creating projects in the non-empty folder was disabled (in #15835) to prevent accidentally selecting Documents or similar folder which is default path in the new project dialog. Doing so will cause Godot to import all files in the folder recursively, creating .import config files all over the place and damaging existing project configs.

@bruvzg
Copy link
Member

bruvzg commented Jun 1, 2020

A quick recap of original deleted #15775 issue, extracted from archived emails.

First posts are missing, but there are some interesting interface improvement suggestions, that were never implemented.

@rcorre
Copy link
Contributor Author

rcorre commented Jun 1, 2020

Thanks for the context! Based on the import-explosion issue, I agree my proposal is not a good idea. A warning dialog might be better, but I also don't want to overcomplicate something that should be simple.

I find that creating projects in nonempty directories is not uncommon for me, but maybe I'm just weird. I could just get in the habit of copying a skeleton project over manually 🤷

@Anutrix
Copy link
Contributor

Anutrix commented Jun 2, 2020

I think that this should not be allowed by default. But we can make it a checkbox somewhere for power users which shows confirmation and/or warning when checked because this behavior still not advisable.

@rcorre
Copy link
Contributor Author

rcorre commented Jun 3, 2020

So, after thinking about it some more, I don't think this is a good solution, nor do I think it is worth adding complexity for the "power users". I'm cool with leaving the current behavior as-is. Power users can figure out how to copy a project skeleton manually.

@rcorre rcorre closed this Jun 3, 2020
@realkotob
Copy link
Contributor

I still think we should always automatically create a new folder inside the chosen folder, this is what Unity does and it works fine.

Why would it be a separate step if it's the workflow we heavily enforce?

@HaSa1002
Copy link
Contributor

HaSa1002 commented Jun 3, 2020

Because you can select an empty folder right away and you would then have to select the parent folder. I like the current way, as it is clear what is done.

@rcorre
Copy link
Contributor Author

rcorre commented Jun 4, 2020

Same, at least for me, forcing the creation of the directory would defeat the point. I specifically want to initialize a project in a directory that already contains assets. I'll think I'll just get in the habit of copying project files over.

@SubSage
Copy link
Contributor

SubSage commented Oct 3, 2020

Can we re-open this? It is rather annoying to have to create a new directory just to instantiate my project where I may already have other content setup (assets and git being popular choices here). I would much rather have a warning dialog, with ok/cancel options for creating my project in a non-empty directory.

Having setup a directory with something else first shouldn't disallow me from creating a project there. I have to specifically remember this weird rule when setting projects for a jam or helping others get started with godot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants