MartinsAccount
Is this the best way to create a list (that can be empty) for use with templates?
I need to do
echo ""
and use initial
because if the script in VENV_TO_INSTALL_STR returns nothing, splitList would create a list with one item of an empty string (this causes problems with range
, for example). To work around this I use initial
, which in this case would return an empty list, however, if the shell script prints some items, that would drop one of those, so I always add an empty echo to account for that case.
Is there a better way of handling this? Also, is there any way to use if statements in ref: keys?
Edit:
I think this parses the stuff in ref: keys: https://github.com/go-task/task/blob/27056a9827ca36f44df72cbd89a98c77c101cb07/internal/templater/templater.go#L47
I tried tricking it by doing }}{{ [if statement stuff] }}{{
but I kept getting various errors, seems like it is expecting it to be only one {{ }} node? I also checked if they can be embedded in parenthesis, but that also didn't work out.3 replies