fabioz / PyDev.Debugger

Sources for the debugger used in PyDev, PyCharm and VSCode Python
Eclipse Public License 1.0
419 stars 121 forks source link

Variables expansion in inline if block #245

Closed alexxbb closed 1 year ago

alexxbb commented 1 year ago

I'm trying to do something like this:

registry_main := "registry_main URL"

publish reg:
    ./scripts/publish.py {{ if reg == "main" { "{{registry_main}}" } else { "{{reg}}" } }}

The variables inside the if block is not expanded to their values so that this recipe expands to:

>>just publish
>>./scripts/publish.py {{registry_main}}

It seems like the if branches must be surrounded with quotes no matter what and this prevents interpolation.

What is the correct way to do this? Also I find it extremely hard to read all these { }. They are used for variable interpolation, they surround the if block, within the if block, and maybe somewhere else. Would it be nicer to use $var or #var variables interpolation?