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

vcreate: re-prompt on invalid project name instead of exiting #19438

Closed
wants to merge 2 commits into from

Conversation

ttytm
Copy link
Member

@ttytm ttytm commented Sep 25, 2023

Assuming that someone still wants to create a V project after entering an invalid project, this change still prints the error but re-prompts for a project name input instead of exiting the project creating process. This spares executing the v new command again.

🤖 Generated by Copilot at 46d8053

Make vcreate more interactive by prompting for a new project name if the input is invalid or existing. Update vcreate.v to implement this behavior.

🤖 Generated by Copilot at 46d8053

  • Add interactive prompts for project name and description to vcreate command (link, F0

@ArtemkaKun
Copy link
Contributor

Do you think you can implement test as well?

@ttytm
Copy link
Member Author

ttytm commented Sep 25, 2023

Do you think you can implement test as well?

When finding a free moment, I'm gonna test if implementing a test is not too big of a hassle to give a better answer to this 👍

@ArtemkaKun
Copy link
Contributor

Sure, if we have no infrastructure for tests of vcreate and implementation of it will be an enormous task - better to focus on something else I believe

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is error prone:

Imagine if someone enters an invalid name like ---, then an invalid name again, etc.

With the previous behavior the early exits will make him always go back to the start, and hitting "up arrow" in the shell is not hard at all.

With the current changes, if you repeat entering an invalid name, eventually you will pass all the checks, and then fail later at creation :-( .
image

@spytheman
Copy link
Member

I think that leaving the repeating to the shell, which is a tool, that specializes in making that more convenient, is more robust, than implementing it piece by piece in the project creation tool, whose main goal (generating lots of boilerplate) is far from it.

@spytheman spytheman closed this Sep 26, 2023
@ttytm
Copy link
Member Author

ttytm commented Sep 26, 2023

Good point. Thanks for the review @spytheman.

@ttytm
Copy link
Member Author

ttytm commented Sep 26, 2023

It could be solved by using a recursive check function. If that's a thing that would consider.

@ttytm ttytm deleted the vcreate/re-prompt branch November 1, 2023 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants