mirror of
https://github.com/tests-always-included/mo.git
synced 2024-12-18 16:27:52 +00:00
5dfb1cd96a
Bug: Did not properly detect the length of an array in mustache-test because I neglected to use `[@]` after the array name. This closes issue #6. Feature: Made {{ARRAY_NAME}} implode array values with commas. Feature: Added an associative array demo script.
17 lines
225 B
Bash
Executable File
17 lines
225 B
Bash
Executable File
#!/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
|