-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Expose the current phase in context #1883
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actual Situation
Extensions have no way of knowing the current phase (aka. questions, render, tasks or migration).
As a consequence, they have to guess which context variable is available and safe for them to use.
Ex:
copier-templates-extensions
was guessing the rendering phase with the presence of_copier_conf
context var but is broken since 9.4 due to its heuristic not working anymoreDesired Situation
Jinja extension can selectively run during the phase they intend to, and they have a safe way of knowing which phase is currently being executed
Proposed solution
In addition to an
_operation
context variable which has already been proposed and pending merge (#1733), a_phase
context variable is also added.Its value can be one of
questions
(orprompt
),render
,migrate
ortasks
.The text was updated successfully, but these errors were encountered: