Skip to content

__prompts__ replacement prompts are ignored for boolean prompts #1893

@howardjones

Description

@howardjones
  • Cookiecutter version: 2.1.2.dev0 (pypi latest today)
  • Python version: 3.8.10
  • Operating System: ubuntu linux

Description:

__prompts__ replacement prompts are ignored for boolean prompts.

What I've run:

{
  "project_name": "Simple Project",
  "__project_slug": "{{ cookiecutter.project_name|lower|replace(' ', '_')|replace('-', '_')|replace('.', '_')|trim }}",
  "__project_dash_slug": "{{ cookiecutter.project_name|lower|replace(' ', '-')|replace('_', '-')|replace('.', '-')|trim }}",
  "version": "1.0.0",
  "with_webserver": false,
  "__prompts__": {
    "project_name": "Name of the project? (package and repo names will be derived from this)",
    "with_webserver": "Do you need a webserver (+Ingress and WAF)"
  }
}

project_name gets a nice prompt, and with_webserver doesn't.

In prompt.py, it looks like prompt_choice_for_config is passed the prompts dict, but read_user_yes_no does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions