MarkdownResume-Pipeline/demo/function-args
Charles N Wyble b64fef2979 Squashed 'vendor/git.knownelement.com/ExternalVendorCode/mo/' content from commit 7e86c1a
git-subtree-dir: vendor/git.knownelement.com/ExternalVendorCode/mo
git-subtree-split: 7e86c1a5f525f352983077d743c2ce2f5d75f4fa
2024-12-09 14:43:00 -06:00

32 lines
705 B
Bash
Executable File

#!/usr/bin/env 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() {
# shellcheck disable=SC2031
cat "${MO_FUNCTION_ARGS[0]}"
}
# Print section title
TITLE() {
echo "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"
# shellcheck disable=SC2031
echo "${MO_FUNCTION_ARGS[0]}"
echo "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"
}
cat <<EOF | mo -u
{{TITLE 'Part 1'}}
{{INCLUDE 'function-args-part1'}}
{{TITLE 'Part 2'}}
{{INCLUDE 'function-args-part2'}}
EOF