Skip to content

Conversation

@davisagli
Copy link
Member

Fixes #47

@stevepiercy
Copy link
Contributor

Could you use this class and methods from cookiecutter instead?

https://github.com/cookiecutter/cookiecutter/blob/b4451231809fb9e4fc2a1e95d433cb030e4b9e06/cookiecutter/prompt.py#L45-L80

I happened to be looking for how to validate any input for #58 (comment).

@davisagli
Copy link
Member Author

@stevepiercy Maybe but it wasn't clear to me how to designate a cookiecutter field as boolean and this gets more complicated if we try to change the type/value that is already returned. So I went with a simple solution.

@stevepiercy
Copy link
Contributor

@davisagli usage is in https://cookiecutter.readthedocs.io/en/stable/advanced/boolean_variables.html. I don't know if showing the default option of False for the prompt is better than No in this case.

Copy link
Member

@rohnsha0 rohnsha0 left a comment

Choose a reason for hiding this comment

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

works for me!

although, I would like:-

[7/17] Should we use prerelease versions? (No):

be changed to:-

[7/17] Should we use prerelease versions? [y/n] (n):

@ericof ericof merged commit f57ccd9 into main Feb 4, 2025
6 checks passed
@ericof ericof deleted the 47-parse-boolean branch February 4, 2025 16:16
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.

"Should we use prerelease versions?" doesn't parse response well

5 participants