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

Augment Project Manager and --path to create the directory if it doesn't exist for slightly quicker project creation #7978

Open
dhoverml opened this issue Oct 3, 2023 · 1 comment

Comments

@dhoverml
Copy link

dhoverml commented Oct 3, 2023

Describe the project you are working on

Any Godot project

Describe the problem or limitation you are having in your project

There are times I want to test an idea with a scene and some scripts, and if I decide to create a new project I have to...

  1. Launch Godot
  2. Click New Project
  3. Set a Project Name
  4. Navigate to a directory
  5. Create a new folder
  6. Give it a name
  7. Click Create & Edit

This doesn't seem like a lot, but when done frequently it becomes a lot.
Additionally, a command line option to create a project would be useful to make this task much faster.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

For the Project Manager, make Create & Edit create the directory if it doesn't exist. This can also pre-fill the path with the project name.
For the command line, make --path create the directory if it doesn't exist. This may need a new flag called --vcs.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Project Manager
Augment + New Project to append the project's name to the end of the default path. If the path does not exist, then Create & Edit is enabled and, when clicked, will create the path.

Currently when I open the Project Manager I see

Project Name: New Game Project
Project Path: /my/home/path

This proposal would change this screen to:

Project Name: New Game Project
Project Path: /my/home/path/New Game Project

And changing the name changes the path, like:

Project Name: My Project
Project Path: /my/home/path/My Project

If the user creates a new directory with Browse and otherwise doesn't change the text after the last forward slash, then the behavior described above still applies

Project Name: My Project
Project Path: /my/home/path/some/other/path/My Project

(this last part is a little weird. Not sure of the best way to go about it or if it shouldn't be implemented)
However if the user changes the text after the forward slash, then setting Project Name will no longer have an effect

Project Name: My Project
Project Path: /my/home/path/DifferentName

Project Name: This is changed again, Project Path is not changed this time
Project Path: /my/home/path/DifferentName

... until Project Name matches the text after the forward slash again

Project Name: DifferentName
Project Path: /my/home/path/DifferentName

Project Name: DifferentNameAgain
Project Path: /my/home/path/DifferentNameAgain

The number of clicks is a little less and doesn't require browsing and creating a new directory:

  1. Launch Godot
  2. Click New Project
  3. Set a Project Name
  4. If the path does not exist, click Create & Edit to create the directory and project
  5. (if the path does exist, and is empty, then Create & Edit functions the same as before)

Command Line
Augment --path to create a project if the directory doesn't exist. The name of the project is the text that follows the last forward slash.

# create a project called "My Project" using `forward_plus` and `git`
./path/to/godot --path "/path/to/My Project"

# create a project called "My Project Mobile" using `mobile` and `git`
./path/to/godot --path /path/to/My_Project_Mobile --rendering-method mobile

# create a project called "My Project Mobile No Git" using `mobile` and no vcs (`--vcs` accepts `[git|none]`)
./path/to/godot --path /path/to/My_Project_Mobile_No_Git --rendering-method mobile --vcs none

I'm on the fence about --vcs since it is a new flag, and I don't know what its behavior should be when not used in this context.

If this enhancement will not be used often, can it be worked around with a few lines of script?

For the Project Manager, yes, but as mentioned above it just requires more clicks.
For the command line, no, it is impossible to create projects from the command line.

Is there a reason why this should be core and not an add-on in the asset library?

This is part of core

@Calinou
Copy link
Member

Calinou commented Oct 3, 2023

The project manager part of this proposal is already tracked in #4749.

Regarding --path, I believe this should be delegated to a separate CLI argument like --init (so that you don't accidentally create new projects if you make a typo in a project path). There's already an open pull request for this, but I can't find it right now.

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

No branches or pull requests

2 participants