mirror of
https://github.com/tests-always-included/mo.git
synced 2024-12-24 02:16:38 +00:00
b16d73b5a7
When you source mo, it adds the "mo" function to the environment.
20 lines
278 B
Bash
Executable File
20 lines
278 B
Bash
Executable File
#!/bin/bash
|
|
|
|
cd "$(dirname "$0")" # Go to the script's directory
|
|
|
|
declare -A DATA
|
|
DATA=([one]=111 [two]=222)
|
|
. ../mo
|
|
|
|
cat <<EOF | mo
|
|
Accessing data directly:
|
|
DATA: {{DATA}}
|
|
One: {{DATA.one}}
|
|
Two: {{DATA.two}}
|
|
|
|
Things in DATA:
|
|
{{#DATA}}
|
|
Item: {{.}}
|
|
{{/DATA}}
|
|
EOF
|