-
Notifications
You must be signed in to change notification settings - Fork 168
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
Expand Jinja templating #922
base: main
Are you sure you want to change the base?
Conversation
constructor/nsis/main.nsi.tmpl
Outdated
{{ SCRIPT_ENV_VARIABLES }} | ||
|
||
{%- for key, val in SCRIPT_ENV_VARIABLES | items %} | ||
System::Call 'kernel32::SetEnvironmentVariable(t,t)i("{{ key }}", {{ val }}).r0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need quotes for val
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok they are pre-escaped in Python. Let's rename this for clarity in the future then:
System::Call 'kernel32::SetEnvironmentVariable(t,t)i("{{ key }}", {{ val }}).r0' | |
System::Call 'kernel32::SetEnvironmentVariable(t,t)i("{{ key }}", {{ escaped_val }}).r0' |
(and in the line above too)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was surprised, too, but we don't do it in the current version either: https://github.com/conda/constructor/blob/main/constructor/winexe.py#L97
Description
#892 introduced a small regression by missing a few template variables for PKG installers. In fixing this regression, I decided to expand the Jinja templating as described in #901.
Specifically, this PR removes custom Python code with Jinja templating logic, which removed a lot of custom Python formatting functions on Windows and simplified the data structures.
Additionally, I patched a few testing issues that broke tests for local test executions and when using the defaults channel.
Closes #901
Checklist - did you ...
news
directory (using the template) for the next release's release notes?