mirror of
https://github.com/tests-always-included/mo.git
synced 2024-12-18 16:27:52 +00:00
30 lines
615 B
Plaintext
30 lines
615 B
Plaintext
|
#!/bin/bash
|
||
|
#
|
||
|
# This sources a simple script with the env. variables needed for the template.
|
||
|
|
||
|
cd "$(dirname "$0")" # Go to the script's directory
|
||
|
source ../mo
|
||
|
|
||
|
export NAME="Alex"
|
||
|
export ARRAY=( AAA BBB CCC )
|
||
|
|
||
|
# Include an external template
|
||
|
INCLUDE() {
|
||
|
cat "$MO_FUNCTION_ARGS"
|
||
|
}
|
||
|
|
||
|
# Print section title
|
||
|
TITLE() {
|
||
|
echo "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"
|
||
|
echo "$MO_FUNCTION_ARGS"
|
||
|
echo "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"
|
||
|
}
|
||
|
|
||
|
cat <<EOF | mo -u
|
||
|
{{TITLE Part 1}}
|
||
|
{{INCLUDE function-args-part1}}
|
||
|
|
||
|
{{TITLE Part 2}}
|
||
|
{{INCLUDE function-args-part2}}
|
||
|
EOF
|