Open nicoaws opened 4 years ago
I've been using this and it is workaround, remember you can use Python syntax inside jinja2
:
Template:
{% set my_array = env_variable.split(',') %}
{% for item in my_array %}Item is : {{ item }}
{% endfor %}
Command: env_variable="1,2,3,4" j2 ./my_template.j2
Output:
Item is : 1
Item is : 2
Item is : 3
Item is : 4
That is not a bash array, but a regular string variable that contains comma-separated values.
Hi! This project gets some interest, but sadly, I'm not maintaining it =\
Maintainer wanted! Discussion: Maintainer Wanted
How would you pass a list/array argument to j2cli via the
-e
option?