tests-always-included / mo

Mustache templates in pure bash
Other
563 stars 67 forks source link

Associative arrays do not work #6

Closed fidian closed 9 years ago

fidian commented 9 years ago

This is split from issue #5.

The following script does not work properly for associative arrays.

#!/bin/bash

declare -A DATA
DATA=([one]=111 [two]=222)

cat <<EOF | . ~/bin/mo
Accessing data directly:
    DATA:  {{DATA}}
    One: {{DATA.one}}
    Two: {{DATA.two}}

Things in DATA:
{{#DATA}}
    Item: {{.}}
{{/DATA}}
EOF

Actual output does not list anything for DATA and no lines for "Item:" are printed. One and Two are looked up correctly. I would expect that two Item lines would be displayed. Not sure if I would expect anything to be displayed for DATA.

fidian commented 9 years ago

This is closed with commit 5dfb1cd.