Skip to content

preserves original options in _cookiecutter#1874

Merged
ericof merged 3 commits intocookiecutter:mainfrom
kjaymiller:kjaymiller-adds-_cookiecutter
Jul 1, 2023
Merged

preserves original options in _cookiecutter#1874
ericof merged 3 commits intocookiecutter:mainfrom
kjaymiller:kjaymiller-adds-_cookiecutter

Conversation

@kjaymiller
Copy link
Copy Markdown
Contributor

fixes #1873

Change to cookiecutter.main.py in cookiecutter() that saves all the original context key:value pairs in context['_cookiecutter'] before overwriting them in context['cookiecutter'].

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

created a new fake-repo directory to add custom key:value pairs to ensure that lists, and dictionaries retained all their values.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

modified the cli echo error output test to no longer rely on exact JSON serialization as result.output was flaky and now also contained _cookiecutter

@ericof ericof requested review from ericof and kurtmckee June 30, 2023 19:27
@ericof ericof added the enhancement This issue/PR relates to a feature request. label Jun 30, 2023
@ericof ericof modified the milestones: 3.0.0, 2.2.0 Jun 30, 2023
Copy link
Copy Markdown
Member

@ericof ericof left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution

@ericof ericof merged commit f177c7c into cookiecutter:main Jul 1, 2023
@noklam
Copy link
Copy Markdown

noklam commented Nov 10, 2023

Is it possible to reference this _cookiecutter variable? I tried {{ _cookiecutter.var }} and seems like I get the same thing.

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

Labels

enhancement This issue/PR relates to a feature request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getting a parameters original choices

3 participants